mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-03 17:59:46 +02:00
GP-0 fix DWARF NPEs when missing regmapping info
This commit is contained in:
parent
5b818293dc
commit
d7ed3a1d35
2 changed files with 8 additions and 6 deletions
|
@ -373,8 +373,10 @@ public class DWARFVariable {
|
|||
return false;
|
||||
}
|
||||
|
||||
type = prog.getDwarfDTM().getPtrTo(type);
|
||||
setRegisterStorage(List.of(exprEvaluator.getLastRegister()));
|
||||
if (exprEvaluator.getLastRegister() != null) {
|
||||
type = prog.getDwarfDTM().getPtrTo(type);
|
||||
setRegisterStorage(List.of(exprEvaluator.getLastRegister()));
|
||||
}
|
||||
}
|
||||
else if (exprEvaluator.isStackRelative()) {
|
||||
if (exprEvaluator.isDeref()) {
|
||||
|
|
|
@ -15,9 +15,8 @@
|
|||
*/
|
||||
package ghidra.app.util.bin.format.dwarf.funcfixup;
|
||||
|
||||
import ghidra.app.util.bin.format.dwarf.DWARFFunction;
|
||||
import ghidra.app.util.bin.format.dwarf.*;
|
||||
import ghidra.app.util.bin.format.dwarf.DWARFFunction.CommitMode;
|
||||
import ghidra.app.util.bin.format.dwarf.DWARFVariable;
|
||||
import ghidra.util.classfinder.ExtensionPointProperties;
|
||||
|
||||
/**
|
||||
|
@ -32,10 +31,11 @@ public class StorageVerificationDWARFFunctionFixup implements DWARFFunctionFixup
|
|||
|
||||
@Override
|
||||
public void fixupDWARFFunction(DWARFFunction dfunc) {
|
||||
DWARFRegisterMappings regMappings = dfunc.getProgram().getRegisterMappings();
|
||||
boolean ignoreStorage = dfunc.getProgram().getImportOptions().isIgnoreParamStorage() ||
|
||||
dfunc.getProgram().getRegisterMappings().isUseFormalParameterStorage();
|
||||
(regMappings != null && regMappings.isUseFormalParameterStorage());
|
||||
boolean isEmptySignature = dfunc.params.isEmpty() && dfunc.retval.isVoidType();
|
||||
if (ignoreStorage || isEmptySignature) {
|
||||
if (regMappings == null || ignoreStorage || isEmptySignature) {
|
||||
dfunc.signatureCommitMode = CommitMode.FORMAL;
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue