mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-11 05:25:32 +03:00
AK: Fix off-by-one in Vector::prepend(Vector&&).
Caught by valgrind's uninitialized access checks on the Vector unit test. Yay for finding bugs with valgrind on the unit tests! :^)
This commit is contained in:
parent
20c6edc976
commit
29a62558c4
Notes:
sideshowbarker
2024-07-19 13:06:22 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/29a62558c4f
@ -362,7 +362,7 @@ public:
|
||||
auto other_size = other.size();
|
||||
grow_capacity(size() + other_size);
|
||||
|
||||
for (int i = size() + other_size - 1; i > other.size(); --i) {
|
||||
for (int i = size() + other_size - 1; i >= other.size(); --i) {
|
||||
new (slot(i)) T(move(at(i - other_size)));
|
||||
at(i - other_size).~T();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user