Corrected handling of stored null pointer within processor test control

blocks
This commit is contained in:
ghidra1 2020-09-11 14:49:14 -04:00
parent 80af51eb9d
commit 076f2908c3

View File

@ -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) {