Skip to content

Ghidra is a software reverse engineering (SRE) framework

Fixed recent Decompiler location regressions

dragonmacheraf7e57263221
diff --git a/Ghidra/Features/Decompiler/src/main/java/ghidra/app/decompiler/location/FunctionNameDecompilerLocation.java b/Ghidra/Features/Decompiler/src/main/java/ghidra/app/decompiler/location/FunctionNameDecompilerLocation.java
index 2233104145..489645e868 100644
--- a/Ghidra/Features/Decompiler/src/main/java/ghidra/app/decompiler/location/FunctionNameDecompilerLocation.java
+++ b/Ghidra/Features/Decompiler/src/main/java/ghidra/app/decompiler/location/FunctionNameDecompilerLocation.java
@@ -37,6 +37,11 @@ public class FunctionNameDecompilerLocation extends FunctionNameFieldLocation
this.info = info;
}
+ public FunctionNameDecompilerLocation() {
+ // for restoring from xml
+ info = new DecompilerLocationInfo();
+ }
+
@Override
public Address getFunctionEntryPoint() {
return info.getFunctionEntryPoint();
diff --git a/Ghidra/Features/Decompiler/src/main/java/ghidra/app/decompiler/location/VariableDecompilerLocation.java b/Ghidra/Features/Decompiler/src/main/java/ghidra/app/decompiler/location/VariableDecompilerLocation.java
index 14f26ce3a9..d5364c5780 100644
--- a/Ghidra/Features/Decompiler/src/main/java/ghidra/app/decompiler/location/VariableDecompilerLocation.java
+++ b/Ghidra/Features/Decompiler/src/main/java/ghidra/app/decompiler/location/VariableDecompilerLocation.java
@@ -38,6 +38,11 @@ public class VariableDecompilerLocation extends VariableLocFieldLocation
this.info = info;
}
+ public VariableDecompilerLocation() {
+ // for restoring from xml
+ info = new DecompilerLocationInfo();
+ }
+
@Override
public Address getFunctionEntryPoint() {
return info.getFunctionEntryPoint();
diff --git a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/pcode/HighFunctionDBUtil.java b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/pcode/HighFunctionDBUtil.java
index eed39ff6f8..5e40a6390d 100644
--- a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/pcode/HighFunctionDBUtil.java
+++ b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/pcode/HighFunctionDBUtil.java
@@ -517,6 +517,10 @@ public class HighFunctionDBUtil {
public static Variable getFunctionVariable(HighSymbol highSymbol) {
+ if (highSymbol == null) {
+ return null;
+ }
+
HighFunction highFunction = highSymbol.getHighFunction();
Function function = highFunction.getFunction();
HighVariable highVar = highSymbol.getHighVariable();