From a11a1cd4d6bfaac0ff76b8eb048acf5bdb9be4c7 Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Thu, 13 May 2021 14:28:32 +0200 Subject: [PATCH] AK: Vector::resize() should initialize new slots for primitive types We call placement new for the newly added slots. However, we should also specify an initializer so primitive data types like u64 are initialized appropriately. --- AK/Vector.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AK/Vector.h b/AK/Vector.h index 7615f984a96..74601a2a89c 100644 --- a/AK/Vector.h +++ b/AK/Vector.h @@ -619,7 +619,7 @@ public: return false; for (size_t i = size(); i < new_size; ++i) - new (slot(i)) T; + new (slot(i)) T {}; m_size = new_size; return true; }