[PATCH] Fixes in LargeMmapAllocator::GetBlockBegin().

Sergey Matveev earthdok at google.com
Thu Apr 4 09:24:07 PDT 2013


Hi kcc, glider, samsonov,

1. Fix boundary condition. 2. Ignore pointers that point into the
meta-region of a chunk.

http://llvm-reviews.chandlerc.com/D624

Files:
  lib/sanitizer_common/sanitizer_allocator.h

Index: lib/sanitizer_common/sanitizer_allocator.h
===================================================================
--- lib/sanitizer_common/sanitizer_allocator.h
+++ lib/sanitizer_common/sanitizer_allocator.h
@@ -1014,7 +1014,9 @@
     CHECK_GE(nearest_chunk, h->map_beg);
     CHECK_LT(nearest_chunk, h->map_beg + h->map_size);
     CHECK_LE(nearest_chunk, p);
-    if (h->map_beg + h->map_size < p)
+    if (h->map_beg + h->map_size <= p)
+      return 0;
+    if (h->map_beg + page_size_ > p)
       return 0;
     return GetUser(h);
   }
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D624.1.patch
Type: text/x-patch
Size: 545 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130404/97fd8e22/attachment.bin>


More information about the llvm-commits mailing list