mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-05-23 22:59:04 +08:00
GT-3116 - Fixed exception on FillOutStructureCmd due to recent changes
This commit is contained in:
-25
@@ -17,11 +17,8 @@ package ghidra.app.plugin.core.decompile;
|
||||
|
||||
import ghidra.app.context.NavigatableActionContext;
|
||||
import ghidra.app.context.RestrictedAddressSetContext;
|
||||
import ghidra.app.decompiler.ClangToken;
|
||||
import ghidra.app.decompiler.component.DecompilerPanel;
|
||||
import ghidra.app.decompiler.component.DecompilerUtils;
|
||||
import ghidra.program.model.address.Address;
|
||||
import ghidra.program.util.ProgramLocation;
|
||||
|
||||
public class DecompilerActionContext extends NavigatableActionContext
|
||||
implements RestrictedAddressSetContext {
|
||||
@@ -51,26 +48,4 @@ public class DecompilerActionContext extends NavigatableActionContext
|
||||
public DecompilerPanel getDecompilerPanel() {
|
||||
return getComponentProvider().getDecompilerPanel();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ProgramLocation getLocation() {
|
||||
|
||||
// prefer the selection over the current location
|
||||
DecompilerPanel decompilerPanel = getDecompilerPanel();
|
||||
ClangToken token = decompilerPanel.getSelectedToken();
|
||||
if (token == null) {
|
||||
token = decompilerPanel.getTokenAtCursor();
|
||||
}
|
||||
|
||||
if (token == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
Address address = DecompilerUtils.getClosestAddress(program, token);
|
||||
if (address == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return new ProgramLocation(program, address);
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -85,7 +85,7 @@ public class FillOutStructureCmd extends BackgroundCommand {
|
||||
super("Fill Out Structure", true, false, true);
|
||||
this.tool = tool;
|
||||
this.currentProgram = program;
|
||||
this.currentLocation = location;
|
||||
this.currentLocation = Objects.requireNonNull(location);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user