[PATCH] D35429: [Sanitizers] Scudo allocator set errno on failure.

Kostya Kortchinsky via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 14 12:08:48 PDT 2017


cryptoad accepted this revision.
cryptoad added a comment.
This revision is now accepted and ready to land.

Thanks for changing the function name! Couple of small comments included.



================
Comment at: lib/scudo/scudo_allocator.cpp:641
 
+inline void *checkPtr(void *ptr) {
+  if (UNLIKELY(!ptr))
----------------
s/inline/INLINE/ for consistency maybe.
Also s/ptr/Ptr (LLVM casing scheme requires uppercase param).


================
Comment at: lib/scudo/scudo_allocator.cpp:697
   }
-  *MemPtr = Instance.allocate(Size, Alignment, FromMemalign);
-  if (!*MemPtr)
-    return ENOMEM;
+  void *ptr = Instance.allocate(Size, Alignment, FromMemalign);
+  if (!ptr)
----------------
s/ptr/Ptr/ as well.


https://reviews.llvm.org/D35429





More information about the llvm-commits mailing list