1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 15:17:46 +00:00

AK: Return early from swap() when swapping the same object

When swapping the same object, we could end up with a double-free error.
This was found while quick-sorting a Vector of Variants holding complex
types, reproduced by the new swap_same_complex_object test case.
This commit is contained in:
Timothy Flynn 2021-08-28 11:19:21 -04:00 committed by Linus Groh
parent aa2e19e58f
commit 587d4663a3
3 changed files with 59 additions and 0 deletions

View file

@ -51,6 +51,7 @@ set(AK_TEST_SOURCES
TestSourceLocation.cpp
TestSpan.cpp
TestStack.cpp
TestStdLibExtras.cpp
TestString.cpp
TestStringUtils.cpp
TestStringView.cpp