[PATCH] D42240: [Support] - Check nullptr after allocation with malloc in MallocAllocator
    Matthias Braun via Phabricator via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Thu Jan 18 09:39:43 PST 2018
    
    
  
MatzeB accepted this revision.
MatzeB added a comment.
This revision is now accepted and ready to land.
LGTM.
================
Comment at: include/llvm/Support/Allocator.h:99-101
+    if (memPtr == nullptr) {
+      report_bad_alloc_error("Allocation in MallocAllocator failed.");
+    }
----------------
Don't use braces around 1-line ifs.
Repository:
  rL LLVM
https://reviews.llvm.org/D42240
    
    
More information about the llvm-commits
mailing list