[llvm-commits] [PATCH] [ASan] Use dylib interposition to hook memory allocation in the dynamic runtime.

Alexander Potapenko glider at google.com
Tue Dec 18 03:25:02 PST 2012



================
Comment at: asan_malloc_mac.cc:368
@@ -383,3 +367,3 @@
 
   // Request the default purgable zone to force its creation. The
   // current default zone is registered with the purgable zone for
----------------
Alexey Samsonov wrote:
> delete this whole block?
done

================
Comment at: asan_malloc_mac.cc:205
@@ -181,1 +204,3 @@
+    asan_free(ptr, &stack);
+    return;
     // If the pointer does not belong to any of the zones, use one of the
----------------
Alexey Samsonov wrote:
> Hm? So the code for free_common is just
> if (!ptr) return;
> GET_STACK_TRACE_FREE;
> asan_free(ptr, &stack);
> ?
Yes. Fixed.

================
Comment at: asan_malloc_mac.cc:146
@@ +145,3 @@
+    return 0;
+  } else {
+    return -1;
----------------
Alexey Samsonov wrote:
> Don't need else after return.
Fixed.

================
Comment at: asan_malloc_mac.cc:346
@@ -362,2 +345,3 @@
   asan_zone.version = 4;
+  // Name must be on heap, because malloc_zone_set_name() may deallocate it.
   asan_zone.zone_name = "asan";
----------------
Kostya Serebryany wrote:
> note sure I understand this comment and the following line
It's just wrong. Removed it.


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



More information about the llvm-commits mailing list