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

Alexey Samsonov samsonov at google.com
Thu Dec 13 23:00:55 PST 2012


  Cool. Do we have many clients on Mac that would have to hack their specific build systems for the dynamic runtime? I think that if installed Clang would be able to produce working binaries with "clang++ -fsanitize=address a.cc" the change is fine.

  minor nits below.


================
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
----------------
delete this whole block?

================
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
----------------
Hm? So the code for free_common is just
if (!ptr) return;
GET_STACK_TRACE_FREE;
asan_free(ptr, &stack);
?

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


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



More information about the llvm-commits mailing list