Skip to content

Fix crash in Bun.build when passing many custom conditions - #30660

Closed
robobun wants to merge 1 commit into
mainfrom
farm/07d1553a/fix-esm-conditions-capacity
Closed

Fix crash in Bun.build when passing many custom conditions#30660
robobun wants to merge 1 commit into
mainfrom
farm/07d1553a/fix-esm-conditions-capacity

Fix capacity underflow in ESMConditions.init when conditions are passed

859785a
Select commit
Loading
Failed to load commit list.
Claude / Claude Code Review completed May 14, 2026 in 13m 3s

Code review found 1 potential issue

Found 4 candidates, confirmed 1. See review comments for details.

Details

Severity Count
🔴 Important 0
🟡 Nit 0
🟣 Pre-existing 1
Severity File:Line Issue
🟣 Pre-existing src/bundler/options.zig:1090-1092 Same if/else precedence footgun remains in loadersFromTransformOptions

Annotations

Check notice on line 1092 in src/bundler/options.zig

See this annotation in the file changed.

@claude claude / Claude Code Review

Same if/else precedence footgun remains in loadersFromTransformOptions

Pre-existing, non-blocking: the identical `if (cond) X else 0 + Y` precedence footgun also exists in `loadersFromTransformOptions` in this same file (lines 1574-1577). It's harmless there — the under-reserved capacity is followed by `getOrPutValue` calls that grow the map, so it only costs an extra rehash — but since this PR exists specifically to eliminate this pattern, you may want to apply the same `@intFromBool` fix there for consistency.