Browse Source

#2822: Fix LiteralSearchStrategy to refer to the AccessorOwner instead of the method, if available.

pull/2828/head
Siegfried Pammer 3 years ago
parent
commit
4c8894a808
  1. 5
      ICSharpCode.ILSpyX/Search/LiteralSearchStrategy.cs

5
ICSharpCode.ILSpyX/Search/LiteralSearchStrategy.cs

@ -90,9 +90,10 @@ namespace ICSharpCode.ILSpyX.Search
if (!md.HasBody() || !MethodIsLiteralMatch(module, md)) if (!md.HasBody() || !MethodIsLiteralMatch(module, md))
continue; continue;
var method = ((MetadataModule)typeSystem.MainModule).GetDefinition(handle); var method = ((MetadataModule)typeSystem.MainModule).GetDefinition(handle);
if (!CheckVisibility(method) || !IsInNamespaceOrAssembly(method)) var result = method.AccessorOwner ?? method;
if (!CheckVisibility(result) || !IsInNamespaceOrAssembly(result))
continue; continue;
OnFoundResult(method); OnFoundResult(result);
} }
foreach (var handle in metadata.FieldDefinitions) foreach (var handle in metadata.FieldDefinitions)

Loading…
Cancel
Save