Fix for GT-2708

This commit is contained in:
caheckman 2019-03-26 16:31:28 -04:00
parent 79d8f164f8
commit 9a8775e18b
2 changed files with 8 additions and 4 deletions

View File

@ -76,8 +76,9 @@ public class DecompilerHoverProvider extends AbstractHoverProvider {
Varnode vn = token.getVarnode(); Varnode vn = token.getVarnode();
if (vn != null) { if (vn != null) {
if (vn.getHigh() instanceof HighGlobal) { HighVariable highVar = vn.getHigh();
reference = vn.getAddress(); if (highVar instanceof HighGlobal) {
reference = highVar.getRepresentative().getAddress();
} }
} }

View File

@ -40,8 +40,7 @@ import ghidra.app.plugin.core.decompile.DecompileClipboardProvider;
import ghidra.program.model.address.*; import ghidra.program.model.address.*;
import ghidra.program.model.listing.Function; import ghidra.program.model.listing.Function;
import ghidra.program.model.listing.Program; import ghidra.program.model.listing.Program;
import ghidra.program.model.pcode.PcodeOp; import ghidra.program.model.pcode.*;
import ghidra.program.model.pcode.Varnode;
import ghidra.program.util.ProgramLocation; import ghidra.program.util.ProgramLocation;
import ghidra.program.util.ProgramSelection; import ghidra.program.util.ProgramSelection;
import ghidra.util.*; import ghidra.util.*;
@ -419,6 +418,10 @@ public class DecompilerPanel extends JPanel implements FieldMouseListener, Field
} }
} }
HighVariable highVar = vn.getHigh();
if (highVar instanceof HighGlobal) {
vn = highVar.getRepresentative();
}
if (vn.isAddress()) { if (vn.isAddress()) {
Address addr = vn.getAddress(); Address addr = vn.getAddress();
if (addr.isMemoryAddress()) { if (addr.isMemoryAddress()) {