mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-28 13:43:45 +03:00
AK: Update HashTables head and tail when shifting during deletion
Otherwise we end up with invalid pointers to them, breaking iteration.
This commit is contained in:
parent
2ca8cf49ca
commit
93945062a7
Notes:
sideshowbarker
2024-07-17 06:46:15 +09:00
Author: https://github.com/Hendiadyoin1 Commit: https://github.com/SerenityOS/serenity/commit/93945062a7 Pull-request: https://github.com/SerenityOS/serenity/pull/17560 Reviewed-by: https://github.com/gmta ✅
@ -654,8 +654,12 @@ private:
|
||||
if constexpr (IsOrdered) {
|
||||
if (bucket->previous)
|
||||
bucket->previous->next = bucket;
|
||||
else
|
||||
m_collection_data.head = bucket;
|
||||
if (bucket->next)
|
||||
bucket->next->previous = bucket;
|
||||
else
|
||||
m_collection_data.tail = bucket;
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user