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

Filipe Cabecinhas via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 24 02:45:36 PST 2016


filcab added a comment.

In https://reviews.llvm.org/D27061#605225, @i.baravy wrote:

> Thank you for the review, guys!
>
> Vitaly,
>  could you suggest a test to update, please? I have no idea how to test this typo.


I'm unsure you can easily test this since, due to the `CHECK_LE(mid, end);` (and no overflow), we know that `end + kMaxRangeToCheck` is bigger than `mid`, so we'll always get mid.
Maybe you can test it by having more than 64 bytes between beg and mid, and poisoning the 33rd byte. That way you know the check shouldn't be able to figure it out and you can check for lack of error (which is what should happen).
Of course, you'd need to add comments explaining you're testing that exact case, and any change to `kMaxRangeToCheck` would need a change in the test.


Repository:
  rL LLVM

https://reviews.llvm.org/D27061





More information about the llvm-commits mailing list