[PATCH] [ASan] Do not rely on malloc context in allocator reports

Alexey Samsonov samsonov at google.com
Mon Nov 11 05:56:39 PST 2013



================
Comment at: lib/sanitizer_common/sanitizer_stacktrace_libcdep.cc:22
@@ +21,3 @@
+
+  if (!max_depth) {
+    trace[0] = pc;
----------------
Why do you need this?

================
Comment at: lib/sanitizer_common/sanitizer_stacktrace.h:36
@@ -35,2 +35,3 @@
                                      int out_size);
+  uptr bp;
   uptr size;
----------------
Consider renaming to top_frame_bp

================
Comment at: lib/asan/lit_tests/TestCases/Linux/malloc_delete_mismatch.cc:22
@@ -17,3 +21,3 @@
 }
 // CHECK: ERROR: AddressSanitizer: alloc-dealloc-mismatch (malloc vs operator delete) on 0x
 // CHECK-NEXT: #0{{.*}}operator delete
----------------
Yeah, and use CHECK-CTX here as well.

================
Comment at: lib/asan/asan_report.cc:567
@@ -566,3 +566,3 @@
 
-void ReportDoubleFree(uptr addr, StackTrace *stack) {
+void ReportDoubleFree(uptr addr, StackTrace *stack_) {
   ScopedInErrorReport in_report;
----------------
better naming: use free_stack instead of stack_ (and also rename parameter in asan_report.h).  Similar for other functions in this file.


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



More information about the llvm-commits mailing list