Skip to content

Conversation

whisk
Copy link
Contributor

@whisk whisk commented Aug 3, 2025

Description

In some rare cases ShiftLeft panics in bitset.go#1490. Minimal example:

a := New(0)
a.Set(560)
a.ShiftLeft(16) // panic

Fix

I believe this is just "off by one" error in the calculation of the needed size. I didn't dig much deeper, so it's possible that this bug has a better fix.

A value that caused panic is added into TestShiftLeft, hovewer this case could be minified if needed.

@lemire
Copy link
Member

lemire commented Aug 4, 2025

The fix looks correct to me.

@lemire lemire merged commit b1e974c into bits-and-blooms:master Aug 4, 2025
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants