Files
rea/tests/fixtures/managedMemberCapacity.ts
T
Can 371f3d91ae fix(managed): retain type discovery after member limits (#5312)
fix(managed): retain types after member limits

Admit type identity and a bounded recovery envelope before member decoding so callers can discover smaller selections after capacity exhaustion.

Fixes #5146

Co-authored-by: eco-null <eco-null@users.noreply.github.com>
Co-authored-by: morluto <76467478+morluto@users.noreply.github.com>
2026-10-23 06:07:03 +08:00

19 lines
620 B
TypeScript

import { buildManagedPeFixture } from "../../src/dotnet/ManagedPe.fixture.js";
/** Valid dense CIL exceeds the unchanged decoding bound, after TypeDef admission. */
export const buildManagedMemberCapacityFixture = (
options: Parameters<typeof buildManagedPeFixture>[0] = {},
): Buffer => {
const il = Buffer.alloc(270_001);
il[il.length - 1] = 0x2a;
const header = Buffer.alloc(12);
header.writeUInt16LE(0x3003);
header.writeUInt16LE(8, 2);
header.writeUInt32LE(il.length, 4);
return buildManagedPeFixture({
additionalEmptyTypes: 2,
...options,
ilBody: Buffer.concat([header, il]),
});
};