From 271bad782b312f037660e0600400b19e7cb47252 Mon Sep 17 00:00:00 2001 From: morluto <76467478+morluto@users.noreply.github.com> Date: Tue, 24 Nov 2026 00:43:46 -0500 Subject: [PATCH] fix(tests): damage Deno PE resource framing the loader-equivalent reader reads #14253 walks resource trees at their RVA whatever the directory Size declares, so shrinking Size no longer made the 65,535-language table malformed and the case reported the entry allowance instead. Point the type directory's entry at a language directory outside the file-backed resource bytes: its header cannot be read, which the reader reports as malformed before counting rows against the allowance. --- tests/acceptance/denoStandaloneCli.test.ts | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/tests/acceptance/denoStandaloneCli.test.ts b/tests/acceptance/denoStandaloneCli.test.ts index 242d5de3c35..d86198e9034 100644 --- a/tests/acceptance/denoStandaloneCli.test.ts +++ b/tests/acceptance/denoStandaloneCli.test.ts @@ -115,14 +115,15 @@ cliTest( }, }); - // The language directory declares one more row than the admitted interval holds. - const [resourceRoot, , languages] = fixture.directoryOffsets; - if (resourceRoot === undefined || languages === undefined) + // Resource trees are read at their RVA whatever the directory Size + // declares, so damage the framing itself: the type directory's entry + // names a language directory outside the file-backed resource bytes. Its + // header cannot be read, which the reader reports before it counts rows + // against the entry allowance. + const [, typeDirectory] = fixture.directoryOffsets; + if (typeDirectory === undefined) throw new Error("Missing resource fixture directories"); - fixture.bytes.writeUInt32LE( - languages - resourceRoot + 16 + 65_535 * 8 - 1, - fixture.directoryAt + 4, - ); + fixture.bytes.writeUInt32LE(0x80000000 + 0x7fff_0000, typeDirectory + 20); await writeFile(path, fixture.bytes); const malformed = await cli.run({ arguments: ["inspect-artifact", path, "--json"],