summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--compiler-rt/lib/lsan/lsan_allocator.cc2
-rw-r--r--compiler-rt/lib/lsan/lsan_interceptors.cc2
-rw-r--r--compiler-rt/lib/scudo/scudo_allocator.cpp3
3 files changed, 3 insertions, 4 deletions
diff --git a/compiler-rt/lib/lsan/lsan_allocator.cc b/compiler-rt/lib/lsan/lsan_allocator.cc
index b867643b608..f54e953731b 100644
--- a/compiler-rt/lib/lsan/lsan_allocator.cc
+++ b/compiler-rt/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/compiler-rt/lib/lsan/lsan_interceptors.cc b/compiler-rt/lib/lsan/lsan_interceptors.cc
index b6ac7b77cfa..49ccb33e2d3 100644
--- a/compiler-rt/lib/lsan/lsan_interceptors.cc
+++ b/compiler-rt/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/compiler-rt/lib/scudo/scudo_allocator.cpp b/compiler-rt/lib/scudo/scudo_allocator.cpp
index a2a3c8ba339..00fa192181a 100644
--- a/compiler-rt/lib/scudo/scudo_allocator.cpp
+++ b/compiler-rt/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);
}
OpenPOWER on IntegriCloud