diff options
author | Advenam Tacet <advenam.tacet@trailofbits.com> | 2023-06-27 03:30:03 +0200 |
---|---|---|
committer | Advenam Tacet <advenam.tacet@trailofbits.com> | 2023-06-27 06:07:03 +0200 |
commit | 0b2c0dc63faa51835b864f1277f4d5ddffc49f6c (patch) | |
tree | 1556ed05bf141fcb2a26a98d7ee3842de2066bbe /compiler-rt | |
parent | ebd0b8a0472b865b7eb6e1a32af97ae31d829033 (diff) | |
download | llvm-0b2c0dc63faa51835b864f1277f4d5ddffc49f6c.zip llvm-0b2c0dc63faa51835b864f1277f4d5ddffc49f6c.tar.gz llvm-0b2c0dc63faa51835b864f1277f4d5ddffc49f6c.tar.bz2 |
[ASan] Remove sanity checks during annotation of contiguous container
This revision removes sanity checks in
`__sanitizer_annotate_contiguous_container`.
(Changed them to `DCHECK_EQ`.)
Those checks may be problematic, if someone manually unpoisoned memory block.
Manual unpoisoning may be used if part of the program is not
instrumented.
Those checks are helpful while confirming correctness of ASan annotations
implementation.
Originally suggested here: https://reviews.llvm.org/D136765#4174546
Reviewed By: vitalybuka
Differential Revision: https://reviews.llvm.org/D145482
Diffstat (limited to 'compiler-rt')
-rw-r--r-- | compiler-rt/lib/asan/asan_poisoning.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler-rt/lib/asan/asan_poisoning.cpp b/compiler-rt/lib/asan/asan_poisoning.cpp index 5164b7d..e99b91d 100644 --- a/compiler-rt/lib/asan/asan_poisoning.cpp +++ b/compiler-rt/lib/asan/asan_poisoning.cpp @@ -449,11 +449,11 @@ void __sanitizer_annotate_contiguous_container(const void *beg_p, // FIXME: Two of these three checks are disabled until we fix // https://github.com/google/sanitizers/issues/258. // if (d1 != d2) - // CHECK_EQ(*(u8*)MemToShadow(d1), old_mid - d1); + // DCHECK_EQ(*(u8*)MemToShadow(d1), old_mid - d1); if (a + granularity <= d1) - CHECK_EQ(*(u8 *)MemToShadow(a), 0); + DCHECK_EQ(*(u8 *)MemToShadow(a), 0); // if (d2 + granularity <= c && c <= end) - // CHECK_EQ(*(u8 *)MemToShadow(c - granularity), + // DCHECK_EQ(*(u8 *)MemToShadow(c - granularity), // kAsanContiguousContainerOOBMagic); uptr b1 = RoundDownTo(new_end, granularity); |