Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BitSet64: Fix iterator incrementation #12473

Conversation

Dentomologist
Copy link
Contributor

Use 1 of the same type as the stored value when shifting left during BitSet iterator incrementation. This prevents undefined behavior caused by shifting an int more than 31 bits in BitSet64.

Previously iterator incrementation could either hang or prematurely report it had reached the end of the BitSet64.

Group numbers and their bitcounts together in pairs, which allows for
range-based loop iteration.
Use 1 of the same type as the stored value when shifting left. This
prevents undefined behavior caused by shifting an int more than 31 bits.

Previously iterator incrementation could either hang or prematurely
report it had reached the end of the bitset.
@Dentomologist Dentomologist force-pushed the bitset64_fix_iterator_incrementation branch from 1c14d97 to 7dbf463 Compare January 1, 2024 08:43
@AdmiralCurtiss AdmiralCurtiss merged commit 043d868 into dolphin-emu:master Jan 1, 2024
11 checks passed
@Dentomologist Dentomologist deleted the bitset64_fix_iterator_incrementation branch January 1, 2024 21:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants