mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-11 13:36:13 +03:00
AK: Zero previous pointer *after* fixing the insertion list in HashTable
This commit is contained in:
parent
f03838fac8
commit
5bf84a5b0e
Notes:
sideshowbarker
2024-07-17 10:01:25 +09:00
Author: https://github.com/Hendiadyoin1 Commit: https://github.com/SerenityOS/serenity/commit/5bf84a5b0e Pull-request: https://github.com/SerenityOS/serenity/pull/14363 Reviewed-by: https://github.com/IdanHo
@ -704,11 +704,11 @@ private:
|
||||
bucket.previous->next = bucket.next;
|
||||
else
|
||||
m_collection_data.head = bucket.next;
|
||||
bucket.previous = nullptr;
|
||||
if (bucket.next)
|
||||
bucket.next->previous = bucket.previous;
|
||||
else
|
||||
m_collection_data.tail = bucket.previous;
|
||||
bucket.previous = nullptr;
|
||||
bucket.next = nullptr;
|
||||
}
|
||||
}
|
||||
|
@ -300,3 +300,12 @@ BENCHMARK_CASE(benchmark_thrashing)
|
||||
table.remove(i);
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE(reinsertion)
|
||||
{
|
||||
OrderedHashTable<String> map;
|
||||
map.set("ytidb::LAST_RESULT_ENTRY_KEY");
|
||||
map.set("__sak");
|
||||
map.remove("__sak");
|
||||
map.set("__sak");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user