[compiler-rt] fix out-of-bounds access in scudo test (#201390) When `I = 0`, we can't do `Array[I-1]`. Caught by libcxx hardening. GitOrigin-RevId: 5708e7fd9eca368b1b519c13a58360a15a263e4f
diff --git a/tests/primary_test.cpp b/tests/primary_test.cpp index cd4b0b8..bedca93 100644 --- a/tests/primary_test.cpp +++ b/tests/primary_test.cpp
@@ -561,7 +561,7 @@ Allocator->pushBlocks(&SizeClassAllocator, ClassId, Array.data(), static_cast<scudo::u32>(Array.size())); - for (size_t I = 0; I < Array.size(); I++) + for (size_t I = 1; I < Array.size(); I++) EXPECT_LE(Array[I - 1] & ~Mask, Array[I] & ~Mask) << "Array not ordered: index " << I - 1 << " is < index " << I;