diff options
author | dim <dim@FreeBSD.org> | 2015-02-22 22:31:36 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2015-02-22 22:31:36 +0000 |
commit | 64036a7c35233ad0f5289d81af95a2b7023eee7e (patch) | |
tree | c80ef9cb2d1e54757027bc3e1b32b98c01ad850c /contrib/compiler-rt/lib/sanitizer_common/sanitizer_allocator.cc | |
parent | 62a5f71b46f317b1666b2f5240bdb30f0c2a2b98 (diff) | |
parent | 5c652b16dfa55fef6d0953359e6e8f6933ee3a0f (diff) | |
download | FreeBSD-src-64036a7c35233ad0f5289d81af95a2b7023eee7e.zip FreeBSD-src-64036a7c35233ad0f5289d81af95a2b7023eee7e.tar.gz |
Update compiler-rt to trunk r228651. This enables using Address
Sanitizer and Undefined Behavior Sanitizer with clang 3.6.0.
Diffstat (limited to 'contrib/compiler-rt/lib/sanitizer_common/sanitizer_allocator.cc')
-rw-r--r-- | contrib/compiler-rt/lib/sanitizer_common/sanitizer_allocator.cc | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/contrib/compiler-rt/lib/sanitizer_common/sanitizer_allocator.cc b/contrib/compiler-rt/lib/sanitizer_common/sanitizer_allocator.cc index 47509f8..03b3e83 100644 --- a/contrib/compiler-rt/lib/sanitizer_common/sanitizer_allocator.cc +++ b/contrib/compiler-rt/lib/sanitizer_common/sanitizer_allocator.cc @@ -14,7 +14,6 @@ #include "sanitizer_allocator.h" #include "sanitizer_allocator_internal.h" #include "sanitizer_common.h" -#include "sanitizer_flags.h" namespace __sanitizer { @@ -61,7 +60,7 @@ InternalAllocator *internal_allocator() { SpinMutexLock l(&internal_alloc_init_mu); if (atomic_load(&internal_allocator_initialized, memory_order_relaxed) == 0) { - internal_allocator_instance->Init(); + internal_allocator_instance->Init(/* may_return_null*/ false); atomic_store(&internal_allocator_initialized, 1, memory_order_release); } } @@ -140,14 +139,12 @@ bool CallocShouldReturnNullDueToOverflow(uptr size, uptr n) { return (max / size) < n; } -void *AllocatorReturnNull() { - if (common_flags()->allocator_may_return_null) - return 0; +void NORETURN ReportAllocatorCannotReturnNull() { Report("%s's allocator is terminating the process instead of returning 0\n", SanitizerToolName); Report("If you don't like this behavior set allocator_may_return_null=1\n"); CHECK(0); - return 0; + Die(); } } // namespace __sanitizer |