diff --git a/Ghidra/Features/Base/src/main/java/ghidra/test/processors/support/PCodeTestAbstractControlBlock.java b/Ghidra/Features/Base/src/main/java/ghidra/test/processors/support/PCodeTestAbstractControlBlock.java index a0c371d894..452ef272be 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/test/processors/support/PCodeTestAbstractControlBlock.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/test/processors/support/PCodeTestAbstractControlBlock.java @@ -184,6 +184,11 @@ public abstract class PCodeTestAbstractControlBlock { protected Address readCodePointer(MemBuffer buffer, int bufferOffset, boolean updateReference) throws MemoryAccessException { Address codePtr = readPointer(buffer, bufferOffset, codeSpace, updateReference); + // treat null pointer as special case - just return it + if (codePtr.getOffset() == 0) { + return codePtr; + } + // shift the pointer if code pointers are stored in memory shifted. int ptrShift = program.getDataTypeManager().getDataOrganization().getPointerShift(); if (ptrShift != 0) {