Browse Source

Drop pending findings when an assembly bails out early

A finding is recorded before the reference context exists, because the resolver
keeps discovering references until the assembly is done. An assembly that fails
in the type system returns without ever reporting its resolutions, so its keys
stayed pending and the next assembly stamped its own reference set onto them.
Naming the wrong references is worse than naming none, in a report that is read
precisely to tell a reference problem from a decompiler defect.

Assisted-by: Claude:claude-opus-5:Claude Code
pull/4131/head
Siegfried Pammer 4 days ago
parent
commit
91e9592353
  1. 4
      TestTools/nugetfuzz.cs

4
TestTools/nugetfuzz.cs

@ -557,6 +557,10 @@ async Task<string> GetPackage(string id, NuGetVersion version) @@ -557,6 +557,10 @@ async Task<string> GetPackage(string id, NuGetVersion version)
async Task DecompileAssembly(string pkg, string dllPath, List<string> searchDirs, NuGetFramework matchTarget, string? fallbackDir)
{
// An assembly that bails out before reporting its resolutions leaves findings behind that
// never received a context. Dropping them here keeps the next assembly from stamping its
// own references onto them, which would name the wrong reference set for the finding.
pendingContext.Clear();
var name = Path.GetFileName(dllPath);
PEFile module;
try

Loading…
Cancel
Save