diff options
author | Kostya Serebryany <kcc@google.com> | 2013-12-23 07:01:43 +0000 |
---|---|---|
committer | Kostya Serebryany <kcc@google.com> | 2013-12-23 07:01:43 +0000 |
commit | 1ddd1aca5678ddf81c8fd8748bf387820a5f1447 (patch) | |
tree | 7d4f36ce38b5afbfe92d2a778acd07fefe57845d /lib/asan/asan_poisoning.cc | |
parent | 8e89495b6cc0f2f6f38875c01c7df02f6cbab4fd (diff) |
[asan] convert a CHECK failure in __sanitizer_annotate_contiguous_container into a proper warning message
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@197899 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/asan/asan_poisoning.cc')
-rw-r--r-- | lib/asan/asan_poisoning.cc | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/asan/asan_poisoning.cc b/lib/asan/asan_poisoning.cc index a4e6c0a23..8320573d7 100644 --- a/lib/asan/asan_poisoning.cc +++ b/lib/asan/asan_poisoning.cc @@ -13,6 +13,8 @@ //===----------------------------------------------------------------------===// #include "asan_poisoning.h" +#include "asan_report.h" +#include "asan_stack.h" #include "sanitizer_common/sanitizer_libc.h" #include "sanitizer_common/sanitizer_flags.h" @@ -270,8 +272,12 @@ void __sanitizer_annotate_contiguous_container(const void *beg_p, uptr old_mid = reinterpret_cast<uptr>(old_mid_p); uptr new_mid = reinterpret_cast<uptr>(new_mid_p); uptr granularity = SHADOW_GRANULARITY; - CHECK(beg <= old_mid && beg <= new_mid && old_mid <= end && new_mid <= end && - IsAligned(beg, granularity)); + if (!(beg <= old_mid && beg <= new_mid && old_mid <= end && new_mid <= end && + IsAligned(beg, granularity))) { + GET_STACK_TRACE_FATAL_HERE; + ReportBadParamsToAnnotateContiguousContainer(beg, end, old_mid, new_mid, + &stack); + } CHECK_LE(end - beg, FIRST_32_SECOND_64(1UL << 30, 1UL << 34)); // Sanity check. |