From 0013718d59c7cdba2e9d4a129ee1146d012d60df Mon Sep 17 00:00:00 2001 From: Andy McFadden Date: Tue, 14 Jan 2020 17:56:55 -0800 Subject: [PATCH] Clear Lv xrefs at start of xref gen Local variable cross-references were accumulating without bound on every refresh. --- SourceGen/DisasmProject.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/SourceGen/DisasmProject.cs b/SourceGen/DisasmProject.cs index 38ddc14..8c67a09 100644 --- a/SourceGen/DisasmProject.cs +++ b/SourceGen/DisasmProject.cs @@ -1442,6 +1442,12 @@ namespace SourceGen { (sym as DefSymbol).Xrefs.Clear(); } } + // TODO: seriously, put the XrefSet ref somewhere else + foreach (LocalVariableTable lvt in LvTables.Values) { + for (int i = 0; i < lvt.Count; i++) { + lvt[i].Xrefs.Clear(); + } + } // Create a mapping from label (which must be unique) to file offset. This // is different from UserLabels (which only has user-created labels, and is @@ -1594,7 +1600,7 @@ namespace SourceGen { } /// - /// Adds an Xref entry to an XrefSet. The XrefSet will be created if necessary. + /// Adds an Xref entry to an XrefSet in mXrefs. The XrefSet will be created if necessary. /// /// File offset for which cross-references are being noted. /// Cross reference to add to the set.