Corrected NPE in decompiler.

Reference overrides must ignore external references.
This commit is contained in:
ghidra1 2019-09-06 18:34:06 -04:00
parent e6cbefc706
commit 2d144fb457
2 changed files with 4 additions and 2 deletions

View File

@ -343,7 +343,9 @@ public class DecompilerUtils {
if (token instanceof ClangFuncNameToken) {
// special case: we know that name tokens do not have addresses
Function function = getFunction(program, (ClangFuncNameToken) token);
return function.getEntryPoint();
if (function != null) {
return function.getEntryPoint();
}
}
Address address = token.getMinAddress();

View File

@ -47,7 +47,7 @@ public class InstructionPcodeOverride implements PcodeOverride {
primaryOverridingReferences = new ArrayList<>();
for (Reference ref : instr.getReferencesFrom()) {
if (!ref.isPrimary()) {
if (!ref.isPrimary() || !ref.getToAddress().isMemoryAddress()) {
continue;
}
RefType type = ref.getReferenceType();