From 3de2dc1287cf841ce7dc15e0635add9bb98a6256 Mon Sep 17 00:00:00 2001 From: Andrew Johnston Date: Tue, 6 Jan 2026 15:04:28 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20use=20the=20computed=20size=20of=20the?= =?UTF-8?q?=20`Offsets`=20struct=20instead=20of=20hard-co=E2=80=A6=20(#258?= =?UTF-8?q?16)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ### What does this PR do? - I was trying to understand how the SEA bundling worked in Bun and noticed the size of the `Offsets` struct is hard-coded here to 32. It should use the computed size to be future proof to changes in the schema. ### How did you verify your code works? - I didn't. Can add tests if this is not covered by existing tests. ChatGPT agreed with me though. =) --- src/StandaloneModuleGraph.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/StandaloneModuleGraph.zig b/src/StandaloneModuleGraph.zig index bfc1ffdb54..6d8ab7784e 100644 --- a/src/StandaloneModuleGraph.zig +++ b/src/StandaloneModuleGraph.zig @@ -1213,7 +1213,7 @@ pub const StandaloneModuleGraph = struct { } } - if (read_amount < trailer.len + @sizeOf(usize) + 32) + if (read_amount < trailer.len + @sizeOf(usize) + @sizeOf(Offsets)) // definitely missing data return null;