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

Avoid modifying vector in HashIndex::mergeSlot when iterating #3429

Merged
merged 1 commit into from
May 1, 2024

Conversation

benjaminwinger
Copy link
Collaborator

It's probably implementation dependent, but std::vector::pop_back will invalidate iterators, even if removing from the back when iterating backwards is safe. This is triggering an assertion in MSVC in debug mode. I've changed it to track how many need to be removed and to remove the elements afterwards.

I also removed the auto entry = *it; part; entry was already overloaded since the HashIndexEntryView has an entry field, and if we're now using an iterator instead of a for each anyway.

@benjaminwinger benjaminwinger merged commit 3b0ce25 into master May 1, 2024
17 checks passed
@benjaminwinger benjaminwinger deleted the fix-hash-index-vector-iterate branch May 1, 2024 20:34
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