mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 15:40:19 +00: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
1 changed files with 1 additions and 1 deletions
|
@ -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 a new issue