mirror of
https://github.com/oven-sh/bun
synced 2026-02-02 15:08:46 +00:00
## Summary Fixes an index out-of-bounds panic that occurs during bundler code splitting on Windows. - The `bytes()` function in `DynamicBitSetUnmanaged` was accessing `masks[0..numMasks(bit_length) + 1]`, reading one element past the allocated array - When the bit set has exactly one mask (bit_length <= 64), this causes a panic: "index out of bounds: index 1, len 1" - The bug manifests when sorting chunk deduplication keys derived from `AutoBitSet.bytes()` The fix simply removes the erroneous `+ 1` from the slice bounds. ## Test plan - [x] `bun bd test test/bundler/bundler_splitting.test.ts` - passes - [x] `bun bd test test/bundler/esbuild/splitting.test.ts` - passes - [x] `bun bd test test/bundler/bundler_regressions.test.ts` - passes - [x] `bun bd test test/bundler/bundler_edgecase.test.ts` - passes 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Bot <claude-bot@bun.sh> Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>