diff options
author | Kostya Serebryany <kcc@google.com> | 2013-09-06 11:04:14 +0000 |
---|---|---|
committer | Kostya Serebryany <kcc@google.com> | 2013-09-06 11:04:14 +0000 |
commit | bd33d3ab168fcbcfe09a3fd6a971994b481e89d0 (patch) | |
tree | aa936c5384774f2b762ef34a360a58bc4f1c840c /lib/tsan/rtl/tsan_interceptors.cc | |
parent | 967e07eccfec5e013df5f77b7dd906abfa6b60d9 (diff) | |
download | compiler-rt-bd33d3ab168fcbcfe09a3fd6a971994b481e89d0.tar.gz compiler-rt-bd33d3ab168fcbcfe09a3fd6a971994b481e89d0.tar.bz2 compiler-rt-bd33d3ab168fcbcfe09a3fd6a971994b481e89d0.tar.xz |
[tsan] make calloc crash instead of returning 0 on overflow (controlled by the allocator_may_return_null flag)
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@190135 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/tsan/rtl/tsan_interceptors.cc')
-rw-r--r-- | lib/tsan/rtl/tsan_interceptors.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/tsan/rtl/tsan_interceptors.cc b/lib/tsan/rtl/tsan_interceptors.cc index 4af8dcb9..d43276e3 100644 --- a/lib/tsan/rtl/tsan_interceptors.cc +++ b/lib/tsan/rtl/tsan_interceptors.cc @@ -443,7 +443,8 @@ TSAN_INTERCEPTOR(void*, __libc_memalign, uptr align, uptr sz) { TSAN_INTERCEPTOR(void*, calloc, uptr size, uptr n) { if (cur_thread()->in_symbolizer) return __libc_calloc(size, n); - if (__sanitizer::CallocShouldReturnNullDueToOverflow(size, n)) return 0; + if (__sanitizer::CallocShouldReturnNullDueToOverflow(size, n)) + return AllocatorReturnNull(); void *p = 0; { SCOPED_INTERCEPTOR_RAW(calloc, size, n); |