From fd5136a1ab4d2b54ce8db80bf3ed93147a654d86 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Mon, 11 Feb 2019 12:44:01 +0100 Subject: [PATCH] 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. --- AK/Vector.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/AK/Vector.h b/AK/Vector.h index 2870f90671..4e6ae11879 100644 --- a/AK/Vector.h +++ b/AK/Vector.h @@ -173,7 +173,8 @@ public: void append(Vector&& other) { if (!m_impl) { - m_impl = move(other.m_impl); + m_impl = other.m_impl; + other.m_impl = nullptr; return; } Vector tmp = move(other);