[test][asan] Simplify a few expressions
authorVitaly Buka <vitalybuka@google.com>
Sun, 27 Nov 2022 20:09:56 +0000 (12:09 -0800)
committerVitaly Buka <vitalybuka@google.com>
Sun, 27 Nov 2022 23:26:24 +0000 (15:26 -0800)
compiler-rt/test/asan/TestCases/contiguous_container.cpp

index ee56f2a..44e419e 100644 (file)
@@ -49,11 +49,11 @@ void TestContainer(size_t capacity, size_t off_begin, bool poison_buffer) {
     __sanitizer_annotate_contiguous_container(st_beg, st_end, old_end, end);
 
     char *cur = buffer;
-    for (; cur < buffer + RoundDown(off_begin); ++cur)
+    for (; cur < RoundDown(st_beg); ++cur)
       assert(__asan_address_is_poisoned(cur) == poison_buffer);
     // The prefix of the first incomplete granule can switch from poisoned to
     // unpoisoned but not otherwise.
-    for (; cur < buffer + off_begin; ++cur)
+    for (; cur < st_beg; ++cur)
       assert(poison_buffer || !__asan_address_is_poisoned(cur));
     for (; cur < end; ++cur)
       assert(!__asan_address_is_poisoned(cur));