diff options
author | Alex Shlyapnikov <alekseys@google.com> | 2017-06-29 21:54:38 +0000 |
---|---|---|
committer | Alex Shlyapnikov <alekseys@google.com> | 2017-06-29 21:54:38 +0000 |
commit | 28b9d0a32fb203911935a6f723cd46843f381b14 (patch) | |
tree | 4e3410b3e8274a70dbd472da5bc6d431fc2d098c /lib | |
parent | 2cd50a16aec00d8d739ff8a8f669027fef286c1d (diff) |
Merge
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@306748 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/lsan/lsan_allocator.cc | 2 | ||||
-rw-r--r-- | lib/lsan/lsan_interceptors.cc | 2 | ||||
-rw-r--r-- | lib/scudo/scudo_allocator.cpp | 3 |
3 files changed, 3 insertions, 4 deletions
diff --git a/lib/lsan/lsan_allocator.cc b/lib/lsan/lsan_allocator.cc index b867643b6..f54e95373 100644 --- a/lib/lsan/lsan_allocator.cc +++ b/lib/lsan/lsan_allocator.cc @@ -135,7 +135,7 @@ void *lsan_realloc(void *p, uptr size, const StackTrace &stack) { void *lsan_calloc(uptr nmemb, uptr size, const StackTrace &stack) { size *= nmemb; - return Allocate(stack, size, 1, true /**/); + return Allocate(stack, size, 1, true); } void *lsan_valloc(uptr size, const StackTrace &stack) { diff --git a/lib/lsan/lsan_interceptors.cc b/lib/lsan/lsan_interceptors.cc index b6ac7b77c..49ccb33e2 100644 --- a/lib/lsan/lsan_interceptors.cc +++ b/lib/lsan/lsan_interceptors.cc @@ -70,7 +70,7 @@ INTERCEPTOR(void*, calloc, uptr nmemb, uptr size) { CHECK(allocated < kCallocPoolSize); return mem; } - if (CallocShouldReturnNullDueToOverflow(size, nmemb)) return nullptr; + if (CheckForCallocOverflow(size, nmemb)) return nullptr; ENSURE_LSAN_INITED; GET_STACK_TRACE_MALLOC; return lsan_calloc(nmemb, size, stack); diff --git a/lib/scudo/scudo_allocator.cpp b/lib/scudo/scudo_allocator.cpp index a2a3c8ba3..00fa19218 100644 --- a/lib/scudo/scudo_allocator.cpp +++ b/lib/scudo/scudo_allocator.cpp @@ -580,8 +580,7 @@ struct ScudoAllocator { void *calloc(uptr NMemB, uptr Size) { initThreadMaybe(); - // TODO(kostyak): switch to CheckForCallocOverflow once D34799 lands. - if (CallocShouldReturnNullDueToOverflow(NMemB, Size)) + if (CheckForCallocOverflow(NMemB, Size)) return FailureHandler::OnBadRequest(); return allocate(NMemB * Size, MinAlignment, FromMalloc, true); } |