fix(dotnet): downgrade truncated CIL identity and coverage

This commit is contained in:
N0zoM1z0
2026-07-17 20:26:22 +08:00
parent 1387be08dd
commit dae6807c4a
44 changed files with 312 additions and 105 deletions
+1 -1
View File
@@ -162,7 +162,7 @@ const managedInstructionAnchorSchema = z.object({
});
const managedMethodBodySchema = z.object({
status: z.enum(["present", "absent", "malformed", "too-large"]),
status: z.enum(["present", "partial", "absent", "malformed", "too-large"]),
header_format: z.enum(["tiny", "fat", "none", "unknown"]),
rva: z.number().int().min(0).max(0xffff_ffff),
file_offset: offsetSchema.nullable(),
+31 -24
View File
@@ -190,7 +190,7 @@ export interface ManagedMemberComparisonSide {
interface Keyed<Item> {
readonly item: Item;
readonly exactKey: string | null;
readonly structuralKey: string;
readonly structuralKey: string | null;
}
interface MatchedPair<Item> {
@@ -335,6 +335,7 @@ const keyMethod = (item: Method): Keyed<Method> => ({
item,
exactKey:
item.signature.parse_status === "decoded" &&
item.body.status === "present" &&
item.body.normalized_il_sha256 !== null
? stableKey([
"method-exact",
@@ -342,29 +343,35 @@ const keyMethod = (item: Method): Keyed<Method> => ({
item.body.normalized_il_sha256,
])
: null,
structuralKey: stableKey([
"method-structural",
item.signature.kind,
item.signature.calling_convention,
item.signature.generic_parameter_count,
item.signature.parameter_count,
item.signature.return_type,
item.signature.parameter_types,
item.body.status,
item.body.header_format,
item.body.il_size,
item.body.max_stack,
item.body.init_locals,
item.body.opcode_counts,
item.body.anchors.map(({ opcode, operand_kind }) => [opcode, operand_kind]),
item.body.exception_regions.map((region) => [
region.flags,
region.try_length,
region.handler_length,
region.class_token === null ? null : "type-token",
region.filter_offset === null ? null : "filter",
]),
]),
structuralKey:
item.body.status === "present"
? stableKey([
"method-structural",
item.signature.kind,
item.signature.calling_convention,
item.signature.generic_parameter_count,
item.signature.parameter_count,
item.signature.return_type,
item.signature.parameter_types,
item.body.status,
item.body.header_format,
item.body.il_size,
item.body.max_stack,
item.body.init_locals,
item.body.opcode_counts,
item.body.anchors.map(({ opcode, operand_kind }) => [
opcode,
operand_kind,
]),
item.body.exception_regions.map((region) => [
region.flags,
region.try_length,
region.handler_length,
region.class_token === null ? null : "type-token",
region.filter_offset === null ? null : "filter",
]),
])
: null,
});
const keyField = (item: Field): Keyed<Field> => ({
+3
View File
@@ -136,6 +136,9 @@ export const importManagedReconstruction = (
(item) =>
item.token === candidate.token &&
item.signature.raw_sha256 === candidate.signature_sha256 &&
item.body.status === "present" &&
item.body.normalized_il_sha256 !== null &&
candidate.normalized_il_sha256 !== null &&
item.body.normalized_il_sha256 === candidate.normalized_il_sha256,
);
if (observed === undefined)
+10 -1
View File
@@ -84,7 +84,13 @@ export const managedRuntimeCorrelationResultSchema = z.strictObject({
normalized_il_sha256: digestSchema.nullable(),
body_sha256: digestSchema.nullable(),
il_size: z.number().int().min(0),
body_status: z.enum(["present", "absent", "malformed", "too-large"]),
body_status: z.enum([
"present",
"partial",
"absent",
"malformed",
"too-large",
]),
exact_build_required: z.literal(true),
}),
requested_runtime: z.strictObject({
@@ -138,6 +144,9 @@ export const planManagedRuntimeCorrelation = (
(item) =>
item.token === input.method.token &&
item.signature.raw_sha256 === input.method.signature_sha256 &&
item.body.status === "present" &&
item.body.normalized_il_sha256 !== null &&
input.method.normalized_il_sha256 !== null &&
item.body.normalized_il_sha256 === input.method.normalized_il_sha256,
);
if (method === undefined)