Fix another crash during dictionary iteration.

Closes #2017.
This commit is contained in:
Robin Sommer 2022-04-13 16:13:23 +02:00
parent 6491db6617
commit 09b132728c
No known key found for this signature in database
GPG key ID: 6BEDA4DA6B8B23E3

View file

@ -1499,6 +1499,14 @@ void Dictionary::AdjustOnRemove(RobustDictIterator* c, const detail::DictEntry&
// if not already the end of the dictionary, adjust next to a valid one.
if ( c->next < Capacity() && table[c->next].Empty() )
c->next = Next(c->next);
if ( c->curr == entry )
{
if ( c->next >= 0 && c->next < Capacity() && ! table[c->next].Empty() )
c->curr = table[c->next];
else
c->curr = detail::DictEntry(nullptr); // -> c == end_robust()
}
}
///////////////////////////////////////////////////////////////////////////////////////////////////