1
0
mirror of https://github.com/fadden/6502bench.git synced 2024-12-01 22:50:35 +00:00

Fix multi-byte local var xrefs

The cross-references for multi-byte local variable table entries were
not showing adjustment values.
This commit is contained in:
Andy McFadden 2020-09-05 18:18:09 -07:00
parent d984e8013a
commit 3f154406d4

View File

@ -1601,10 +1601,9 @@ namespace SourceGen {
} else if (dfd.SymbolRef.IsVariable) { } else if (dfd.SymbolRef.IsVariable) {
DefSymbol defSym = lvLookup.GetSymbol(offset, dfd.SymbolRef); DefSymbol defSym = lvLookup.GetSymbol(offset, dfd.SymbolRef);
if (defSym != null) { if (defSym != null) {
int adj = 0; // The operand address and defSym value are both zero-page
if (operandOffset >= 0) { // locations, likely outside the file (so no OperandOffset).
adj = defSym.Value - operandOffset; int adj = defSym.Value - attr.OperandAddress;
}
defSym.Xrefs.Add(new XrefSet.Xref(offset, true, xrefType, accType, defSym.Xrefs.Add(new XrefSet.Xref(offset, true, xrefType, accType,
accessFlags, adj)); accessFlags, adj));
} }