mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-05 10:49:34 +02:00
GP-3452: PointerType.RELATIVE now treats 0 as NaP
This commit is contained in:
parent
ce8fadf7a8
commit
d3ab0197c2
1 changed files with 5 additions and 1 deletions
|
@ -445,7 +445,7 @@ public class PointerDataType extends BuiltIn implements Pointer {
|
||||||
if (pointerType == PointerType.IMAGE_BASE_RELATIVE) {
|
if (pointerType == PointerType.IMAGE_BASE_RELATIVE) {
|
||||||
if (addrOffset == 0) {
|
if (addrOffset == 0) {
|
||||||
// Done for consistency with old ImageBaseOffsetDataType.
|
// Done for consistency with old ImageBaseOffsetDataType.
|
||||||
// A 0 relative offset is considerd invalid (NaP)
|
// A 0 relative offset is considered invalid (NaP)
|
||||||
return null; // NaP without error
|
return null; // NaP without error
|
||||||
}
|
}
|
||||||
if (mem == null) {
|
if (mem == null) {
|
||||||
|
@ -457,6 +457,10 @@ public class PointerDataType extends BuiltIn implements Pointer {
|
||||||
return imageBase.addWrap(addrOffset * targetSpace.getAddressableUnitSize());
|
return imageBase.addWrap(addrOffset * targetSpace.getAddressableUnitSize());
|
||||||
}
|
}
|
||||||
else if (pointerType == PointerType.RELATIVE) {
|
else if (pointerType == PointerType.RELATIVE) {
|
||||||
|
if (addrOffset == 0) {
|
||||||
|
// A 0 relative offset is considered invalid (NaP)
|
||||||
|
return null; // NaP without error
|
||||||
|
}
|
||||||
// must ignore AddressSpaceSettingsDefinition
|
// must ignore AddressSpaceSettingsDefinition
|
||||||
Address base = buf.getAddress();
|
Address base = buf.getAddress();
|
||||||
targetSpace = base.getAddressSpace();
|
targetSpace = base.getAddressSpace();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue