Skip to content

Conversation

@lucascool12
Copy link
Contributor

@lucascool12 lucascool12 commented Jan 9, 2026

Fixes an overflow bug on 32 bit builds in the is_full method of RoaringTreemap.

@lucascool12 lucascool12 force-pushed the fix-32bit-build-treemap-len branch from 441ee18 to ebf36a0 Compare January 9, 2026 10:21
Copy link
Member

@Kerollmops Kerollmops left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whoops, yeah, you are absolutely right. Thank you!

@Kerollmops Kerollmops added this pull request to the merge queue Jan 12, 2026
Merged via the queue into RoaringBitmap:main with commit 69e4bbd Jan 12, 2026
15 checks passed
/// ```
pub fn is_full(&self) -> bool {
self.map.len() == (u32::MAX as usize + 1) && self.map.values().all(RoaringBitmap::is_full)
self.map.len() == (u32::MAX as u64 + 1) as usize
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this testing that length is zero on a 32 bit machine?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I really didn't think of this.

Using the len method on a 32-bit machine to test if a RoaringTreemap is full will never work due to the signature of len.
Atleast calling is_full doesn't panic in debug builds now, but this is not a proper fix.

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.

3 participants