diff options
author | Kostya Serebryany <kcc@google.com> | 2012-07-25 10:56:09 +0000 |
---|---|---|
committer | Kostya Serebryany <kcc@google.com> | 2012-07-25 10:56:09 +0000 |
commit | bb0ade6daa621b300ba68e736dcd19cd3c3bcc71 (patch) | |
tree | 00e34b3028a39b39520e74ab10a1a8dc4eb4c8c1 /compiler-rt/lib/asan/asan_rtl.cc | |
parent | c145b026072a9eb7d62cb726c90b8f40e8194ecd (diff) | |
download | bcm5719-llvm-bb0ade6daa621b300ba68e736dcd19cd3c3bcc71.tar.gz bcm5719-llvm-bb0ade6daa621b300ba68e736dcd19cd3c3bcc71.zip |
[asan] don't return from a never-return function. fix a test that had a chain of bugs instead of just one
llvm-svn: 160719
Diffstat (limited to 'compiler-rt/lib/asan/asan_rtl.cc')
-rw-r--r-- | compiler-rt/lib/asan/asan_rtl.cc | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/compiler-rt/lib/asan/asan_rtl.cc b/compiler-rt/lib/asan/asan_rtl.cc index 5e6e8154718..34324fa16d0 100644 --- a/compiler-rt/lib/asan/asan_rtl.cc +++ b/compiler-rt/lib/asan/asan_rtl.cc @@ -387,9 +387,15 @@ void NOINLINE __asan_set_error_report_callback(void (*callback)(const char*)) { void __asan_report_error(uptr pc, uptr bp, uptr sp, uptr addr, bool is_write, uptr access_size) { - // Do not print more than one report, otherwise they will mix up. static atomic_uint32_t num_calls; - if (atomic_fetch_add(&num_calls, 1, memory_order_relaxed) != 0) return; + if (atomic_fetch_add(&num_calls, 1, memory_order_relaxed) != 0) { + // Do not print more than one report, otherwise they will mix up. + // We can not return here because the function is marked as never-return. + AsanPrintf("AddressSanitizer: while reporting a bug found another one." + "Ignoring.\n"); + SleepForSeconds(5); + Die(); + } AsanPrintf("====================================================" "=============\n"); |