[PATCH] [asan] LSan hooks in asan_allocator2.cc

Kostya Serebryany kcc at google.com
Mon May 20 07:13:42 PDT 2013



================
Comment at: lib/asan/asan_allocator2.cc:31
@@ -30,1 +30,3 @@
 
+#if SANITIZE_LEAKS
+#include "lsan/lsan_common.h"
----------------
no #ifs please

================
Comment at: lib/asan/asan_allocator2.cc:171
@@ -166,1 +170,3 @@
   u32 rz_log            : 3;
+#if SANITIZE_LEAKS
+  u32 lsan_tag          : 2;
----------------
no #ifs please

================
Comment at: lib/asan/asan_allocator2.cc:711
@@ +710,3 @@
+// --- Implementation of LSan-specific functions --- {{{1
+#if SANITIZE_LEAKS
+namespace __lsan {
----------------
can you avoid this #if here too? 

================
Comment at: lib/asan/asan_allocator2.cc:731
@@ +730,3 @@
+  uptr chunk = m->Beg();
+  if ((m->chunk_state == __asan::CHUNK_ALLOCATED) && (addr >= chunk) &&
+      addr < chunk + m->UsedSize())
----------------
This should be a method of AsanChunk
There is AddrIsInside in AsanChunkView, but not in AsanChunk



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



More information about the llvm-commits mailing list