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

Evgenii Stepanov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 28 17:41:49 PDT 2017


eugenis accepted this revision.
eugenis added inline comments.
This revision is now accepted and ready to land.


================
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();
----------------
Could you rename this to something like CallocShouldFailDueToOverflow or even CallocWouldOverflow ?


https://reviews.llvm.org/D34786





More information about the llvm-commits mailing list