fix(dotnet): compare members with undecoded signatures by exact identity
`compare_managed_members` gave undecoded (unsupported or malformed) signatures no match key at all. In complete inventories every such member was then reported as removed on one side and added on the other, even for byte-identical assemblies: comparing PSReadLine.dll with itself reported 457 added and 457 removed members, mostly generic instantiations the signature decoder does not support. The raw signature blob is the exact signature, so methods and fields now pair by exact declared type, name, and raw signature without decoding. An undecoded member that still has no counterpart is reported as unknown with a `signature-not-decoded` limitation, never added or removed, because no shape round could look for a changed counterpart. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
dd114d3980
commit
d52af3b321
@@ -58,15 +58,13 @@ const keyMethod = (item: Method): Keyed<Method> => ({
|
||||
item.body.normalized_il_sha256,
|
||||
])
|
||||
: null,
|
||||
signatureKey:
|
||||
item.signature.parse_status === "decoded"
|
||||
? stableKey([
|
||||
"method-signature",
|
||||
item.declaring_type,
|
||||
item.name,
|
||||
item.signature.raw_sha256,
|
||||
])
|
||||
: null,
|
||||
// The raw blob is the exact signature; decoding only feeds shape keys.
|
||||
signatureKey: stableKey([
|
||||
"method-signature",
|
||||
item.declaring_type,
|
||||
item.name,
|
||||
item.signature.raw_sha256,
|
||||
]),
|
||||
structuralKey:
|
||||
item.signature.parse_status === "decoded" && item.body.status === "present"
|
||||
? stableKey([
|
||||
@@ -104,7 +102,14 @@ const keyField = (item: Field): Keyed<Field> => ({
|
||||
item.signature.parse_status === "decoded"
|
||||
? stableKey(["field-exact", item.signature.raw_sha256])
|
||||
: null,
|
||||
signatureKey: null,
|
||||
// Only an undecoded field reaches this round: a decoded field with the
|
||||
// same raw signature already met its counterpart in the exact round.
|
||||
signatureKey: stableKey([
|
||||
"field-signature",
|
||||
item.declaring_type,
|
||||
item.name,
|
||||
item.signature.raw_sha256,
|
||||
]),
|
||||
structuralKey: stableKey([
|
||||
"field-structural",
|
||||
item.signature.kind,
|
||||
@@ -143,7 +148,12 @@ const matchFields = (
|
||||
left,
|
||||
right,
|
||||
exactBasis: "field-signature",
|
||||
fallbackBases: [],
|
||||
fallbackBases: [
|
||||
{
|
||||
basis: "exact-signature",
|
||||
key: ({ signatureKey }) => signatureKey,
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
export type ManagedMethodMatches = ReturnType<typeof matchMethods>;
|
||||
|
||||
Reference in New Issue
Block a user