mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 07:30:19 +00:00
AK: Oops, the optimization in Vector::append(Vector&&) was broken.
It forgot to clear out the moved-from vector. It's easy to see where this bug came from: I assumed m_impl was an OwnPtr. It would be comfy if move() on some arbitrary T* would also null it out but alas that's not how things work.
This commit is contained in:
parent
298a49c688
commit
fd5136a1ab
Notes:
sideshowbarker
2024-07-19 15:47:28 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/fd5136a1ab4
1 changed files with 2 additions and 1 deletions
|
@ -173,7 +173,8 @@ public:
|
|||
void append(Vector<T>&& other)
|
||||
{
|
||||
if (!m_impl) {
|
||||
m_impl = move(other.m_impl);
|
||||
m_impl = other.m_impl;
|
||||
other.m_impl = nullptr;
|
||||
return;
|
||||
}
|
||||
Vector<T> tmp = move(other);
|
||||
|
|
Loading…
Reference in a new issue