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

<deque>: Add missed masking of _First_used_block_idx in deque::shrink_to_fit to correctly end the loop #4955

Merged
merged 2 commits into from
Sep 19, 2024

Conversation

frederick-vs-ja
Copy link
Contributor

Fixes #4954.

In #4091, _First_used_block_idx was incorrectly unmasked. In some problematic cases, _First_used_block_idx can become larger than _Mask, which could render the loop infinite.

@frederick-vs-ja frederick-vs-ja requested a review from a team as a code owner September 13, 2024 10:18
@CaseyCarter CaseyCarter added the bug Something isn't working label Sep 13, 2024
@StephanTLavavej StephanTLavavej self-assigned this Sep 13, 2024
@CaseyCarter CaseyCarter self-requested a review September 14, 2024 00:14
@StephanTLavavej
Copy link
Member

I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed.

@StephanTLavavej StephanTLavavej merged commit 397901c into microsoft:main Sep 19, 2024
39 checks passed
@StephanTLavavej
Copy link
Member

Thanks for fixing this runtime correctness regression in the STL's best and universally adored data structure! 🐞 🛠️ 😹

@frederick-vs-ja frederick-vs-ja deleted the deque-missed-mask branch September 19, 2024 23:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Endless loop in deque::shrink_to_fit()
3 participants