mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-11 05:25:32 +03:00
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.
This commit is contained in:
parent
339b368308
commit
a11a1cd4d6
Notes:
sideshowbarker
2024-07-18 18:12:05 +09:00
Author: https://github.com/gunnarbeutner Commit: https://github.com/SerenityOS/serenity/commit/a11a1cd4d6b Pull-request: https://github.com/SerenityOS/serenity/pull/7090 Reviewed-by: https://github.com/awesomekling
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user