From 3f154406d4a6b191bc63bb18293846e10863157d Mon Sep 17 00:00:00 2001 From: Andy McFadden Date: Sat, 5 Sep 2020 18:18:09 -0700 Subject: [PATCH] Fix multi-byte local var xrefs The cross-references for multi-byte local variable table entries were not showing adjustment values. --- SourceGen/DisasmProject.cs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/SourceGen/DisasmProject.cs b/SourceGen/DisasmProject.cs index e01182d..be481cb 100644 --- a/SourceGen/DisasmProject.cs +++ b/SourceGen/DisasmProject.cs @@ -1601,10 +1601,9 @@ namespace SourceGen { } else if (dfd.SymbolRef.IsVariable) { DefSymbol defSym = lvLookup.GetSymbol(offset, dfd.SymbolRef); if (defSym != null) { - int adj = 0; - if (operandOffset >= 0) { - adj = defSym.Value - operandOffset; - } + // The operand address and defSym value are both zero-page + // locations, likely outside the file (so no OperandOffset). + int adj = defSym.Value - attr.OperandAddress; defSym.Xrefs.Add(new XrefSet.Xref(offset, true, xrefType, accType, accessFlags, adj)); }