[PATCH] D35414: [Support] [IR] [ADT] - Check nullptr after allocation with malloc/realloc or calloc

Klaus Kretzschmar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 14 06:08:15 PDT 2017


kkretzsch created this revision.

As a follow up of the bad alloc handler patch, this patch introduces nullptr checks on pointers returned from the 
malloc/realloc/calloc functions.  In addition some memory size assignments  are moved behind the allocation  
of the corresponding memory to fulfill exception safe memory management (RAII).

patch by Klaus Kretzschmar


Repository:
  rL LLVM

https://reviews.llvm.org/D35414

Files:
  include/llvm/ADT/SmallVector.h
  include/llvm/ADT/StringMap.h
  lib/IR/DataLayout.cpp
  lib/Support/FoldingSet.cpp
  lib/Support/SmallPtrSet.cpp
  lib/Support/SmallVector.cpp
  lib/Support/StringMap.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D35414.106631.patch
Type: text/x-patch
Size: 7533 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170714/f63ba23e/attachment.bin>


More information about the llvm-commits mailing list