From 605cb6a57c148ed27d5a835ae4776b048833aa56 Mon Sep 17 00:00:00 2001 From: ElektroKill Date: Sat, 9 Sep 2023 13:42:25 +0200 Subject: [PATCH] Fix a comparison bug causing incorrect analyzer results --- Extensions/dnSpy.Analyzer/TreeNodes/Helpers.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Extensions/dnSpy.Analyzer/TreeNodes/Helpers.cs b/Extensions/dnSpy.Analyzer/TreeNodes/Helpers.cs index eede7181f6..871f97ebab 100644 --- a/Extensions/dnSpy.Analyzer/TreeNodes/Helpers.cs +++ b/Extensions/dnSpy.Analyzer/TreeNodes/Helpers.cs @@ -86,7 +86,8 @@ static MethodDef GetOriginalCodeLocation(MethodDef method) { } internal static bool CheckEquals(IMemberRef? mr1, IMemberRef? mr2) => - new SigComparer(SigComparerOptions.CompareDeclaringTypes | SigComparerOptions.PrivateScopeIsComparable).Equals(mr1, mr2); + new SigComparer(SigComparerOptions.CompareDeclaringTypes | SigComparerOptions.PrivateScopeIsComparable | + SigComparerOptions.ReferenceCompareForMemberDefsInSameModule).Equals(mr1, mr2); static MethodDef? FindVariableOfTypeUsageInType(TypeDef type, TypeDef variableType) { foreach (MethodDef method in type.Methods) {