mirror of
https://github.com/oven-sh/bun
synced 2026-02-14 21:01:52 +00:00
fix: use the computed size of the Offsets struct instead of hard-co… (#25816)
### 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. =)
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user