[PATCH] D34786: [LSan] Make LSan allocator allocator_may_return_null compliant

Aleksey Shlyapnikov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 28 18:02:17 PDT 2017


alekseyshl added inline comments.


================
Comment at: lib/lsan/lsan_allocator.cc:137
 void *lsan_calloc(uptr nmemb, uptr size, const StackTrace &stack) {
+  if (CallocShouldReturnNullDueToOverflow(size, nmemb))
+    return Allocator::FailureHandler::OnBadRequest();
----------------
eugenis wrote:
> Could you rename this to something like CallocShouldFailDueToOverflow or even CallocWouldOverflow ?
Will do as a separate patch.


https://reviews.llvm.org/D34786





More information about the llvm-commits mailing list