[PATCH] D27061: [asan] Avoid duplicate and redundant poisoning checks in __sanitizer_contiguous_container_find_bad_address

Vitaly Buka via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 23 14:25:58 PST 2016


vitalybuka added inline comments.


================
Comment at: lib/asan/asan_poisoning.cc:423
       return reinterpret_cast<const void *>(i);
   for (uptr i = r2_beg; i < mid; i++)
     if (AddressIsPoisoned(i))
----------------
eugenis wrote:
> vitalybuka wrote:
> > Could you please combine these
> > for (uptr i = r2_beg; i < mid; i++)
> > for (uptr i = mid; i < r2_end; i++)
> > 
> > into
> > for (uptr i = r2_beg; i < r2_end; i++)
> But these loops check for opposite conditions. Now it is simply wrong: bytes after mid must be poisoned.
Oh, I didn't notice this, please undo this part.


Repository:
  rL LLVM

https://reviews.llvm.org/D27061





More information about the llvm-commits mailing list