Skip to content

Ghidra is a software reverse engineering (SRE) framework

GT-2640 - fixing decompiler context to always return a DecompilerLocation or null

ghidravore38ef7ce79296
diff --git a/Ghidra/Features/Decompiler/src/main/java/ghidra/app/plugin/core/decompile/DecompilerProvider.java b/Ghidra/Features/Decompiler/src/main/java/ghidra/app/plugin/core/decompile/DecompilerProvider.java
index 5ab4aa81bb..c3005ecfbc 100644
--- a/Ghidra/Features/Decompiler/src/main/java/ghidra/app/plugin/core/decompile/DecompilerProvider.java
+++ b/Ghidra/Features/Decompiler/src/main/java/ghidra/app/plugin/core/decompile/DecompilerProvider.java
@@ -201,10 +201,10 @@ public class DecompilerProvider extends NavigatableComponentProviderAdapter
@Override
public ProgramLocation getLocation() {
- if (currentLocation == null) {
- return plugin.getCurrentLocation(); // avoid returning null
+ if (currentLocation instanceof DecompilerLocation) {
+ return currentLocation;
}
- return currentLocation;
+ return controller.getDecompilerPanel().getCurrentLocation();
}
@Override