From: Christopher Ferris Date: Tue, 13 Jun 2023 01:59:01 +0000 (-0700) Subject: [scudo] Fix MallocIterateBoundary on 32 bit. X-Git-Tag: upstream/17.0.6~5312 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5e691a1c9b0ad22689d4a434ddf4fed940e58dec;p=platform%2Fupstream%2Fllvm.git [scudo] Fix MallocIterateBoundary on 32 bit. On Android, the 32 bit value of 8 for BlockDelta results in a failure because a valid pointer can never be found. Change the code to always use 16 which passes on both 32 bit and 64 bit. Verified that re-introducing the old bug causes the test to fail on both 32 bit and 64 with the new BlockDelta value. Reviewed By: Chia-hungDuan Differential Revision: https://reviews.llvm.org/D152767 --- diff --git a/compiler-rt/lib/scudo/standalone/tests/wrappers_c_test.cpp b/compiler-rt/lib/scudo/standalone/tests/wrappers_c_test.cpp index 05d1d48..26bab8d 100644 --- a/compiler-rt/lib/scudo/standalone/tests/wrappers_c_test.cpp +++ b/compiler-rt/lib/scudo/standalone/tests/wrappers_c_test.cpp @@ -333,7 +333,7 @@ static void callback(uintptr_t Base, size_t Size, void *Arg) { // block is a boundary for. It must only be seen once by the callback function. TEST(ScudoWrappersCTest, MallocIterateBoundary) { const size_t PageSize = sysconf(_SC_PAGESIZE); - const size_t BlockDelta = FIRST_32_SECOND_64(8U, 16U); + const size_t BlockDelta = 16U; const size_t SpecialSize = PageSize - BlockDelta; // We aren't guaranteed that any size class is exactly a page wide. So we need