[PATCH] D24777: [asan] Store full AddressDescription objects in ErrorInvalidPointerPair

Filipe Cabecinhas via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 21 12:29:47 PDT 2016


This revision was automatically updated to reflect the committed changes.
Closed by commit rL282102: [asan] Store full AddressDescription objects in ErrorInvalidPointerPair (authored by filcab).

Changed prior to commit:
  https://reviews.llvm.org/D24777?vs=71981&id=72095#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D24777

Files:
  compiler-rt/trunk/lib/asan/asan_errors.cc
  compiler-rt/trunk/lib/asan/asan_errors.h

Index: compiler-rt/trunk/lib/asan/asan_errors.h
===================================================================
--- compiler-rt/trunk/lib/asan/asan_errors.h
+++ compiler-rt/trunk/lib/asan/asan_errors.h
@@ -279,13 +279,20 @@
 };
 
 struct ErrorInvalidPointerPair : ErrorBase {
-  uptr pc, bp, sp, p1, p2;
+  uptr pc, bp, sp;
+  AddressDescription addr1_description;
+  AddressDescription addr2_description;
   // VS2013 doesn't implement unrestricted unions, so we need a trivial default
   // constructor
   ErrorInvalidPointerPair() = default;
-  ErrorInvalidPointerPair(u32 tid, uptr pc_, uptr bp_, uptr sp_, uptr p1_,
-                          uptr p2_)
-      : ErrorBase(tid), pc(pc_), bp(bp_), sp(sp_), p1(p1_), p2(p2_) {}
+  ErrorInvalidPointerPair(u32 tid, uptr pc_, uptr bp_, uptr sp_, uptr p1,
+                          uptr p2)
+      : ErrorBase(tid),
+        pc(pc_),
+        bp(bp_),
+        sp(sp_),
+        addr1_description(p1, 1, /*shouldLockThreadRegistry=*/false),
+        addr2_description(p2, 1, /*shouldLockThreadRegistry=*/false) {}
   void Print();
 };
 
Index: compiler-rt/trunk/lib/asan/asan_errors.cc
===================================================================
--- compiler-rt/trunk/lib/asan/asan_errors.cc
+++ compiler-rt/trunk/lib/asan/asan_errors.cc
@@ -271,12 +271,13 @@
   const char *bug_type = "invalid-pointer-pair";
   Decorator d;
   Printf("%s", d.Warning());
-  Report("ERROR: AddressSanitizer: invalid-pointer-pair: %p %p\n", p1, p2);
+  Report("ERROR: AddressSanitizer: invalid-pointer-pair: %p %p\n",
+         addr1_description.Address(), addr2_description.Address());
   Printf("%s", d.EndWarning());
   GET_STACK_TRACE_FATAL(pc, bp);
   stack.Print();
-  PrintAddressDescription(p1, 1, bug_type);
-  PrintAddressDescription(p2, 1, bug_type);
+  addr1_description.Print();
+  addr2_description.Print();
   ReportErrorSummary(bug_type, &stack);
 }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D24777.72095.patch
Type: text/x-patch
Size: 1913 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160921/a1a1ca9e/attachment.bin>


More information about the llvm-commits mailing list