diff --git a/Ghidra/Framework/Emulation/src/main/java/ghidra/pcode/exec/BytesPcodeExecutorStateSpace.java b/Ghidra/Framework/Emulation/src/main/java/ghidra/pcode/exec/BytesPcodeExecutorStateSpace.java index 757de237a5..7bb578de05 100644 --- a/Ghidra/Framework/Emulation/src/main/java/ghidra/pcode/exec/BytesPcodeExecutorStateSpace.java +++ b/Ghidra/Framework/Emulation/src/main/java/ghidra/pcode/exec/BytesPcodeExecutorStateSpace.java @@ -185,12 +185,18 @@ public class BytesPcodeExecutorStateSpace { } } - Iterator it = - uninitialized.complement(ULongSpan.extent(offset, size)).iterator(); - if (it.hasNext()) { - ULongSpan init = it.next(); - if (init.min().longValue() == offset) { - return readBytes(offset, (int) init.length(), reason); + /** + * The decoder will buffer ahead, so give it as much as we can, but no more than is actually + * initialized. If it's a (non-decode) read, give it everything, but invoke the warning. + */ + if (reason == Reason.EXECUTE_DECODE) { + Iterator it = + uninitialized.complement(ULongSpan.extent(offset, size)).iterator(); + if (it.hasNext()) { + ULongSpan init = it.next(); + if (init.min().longValue() == offset) { + return readBytes(offset, (int) init.length(), reason); + } } }