Hi.

I've tested the revision that I'm planning to cherry pick on x86_64-linux-gnu.

I'm going to install the patch.
Martin

libsanitizer/ChangeLog:

2018-12-27  Martin Liska  <mli...@suse.cz>

        * asan/asan_errors.cc (ErrorAllocTypeMismatch::Print): Cherry
        pick rL350085.
        * asan/asan_errors.h (struct ErrorAllocTypeMismatch): Likewise.
---
 libsanitizer/asan/asan_errors.cc | 5 ++---
 libsanitizer/asan/asan_errors.h  | 7 +++----
 2 files changed, 5 insertions(+), 7 deletions(-)


diff --git a/libsanitizer/asan/asan_errors.cc b/libsanitizer/asan/asan_errors.cc
index b9d02a74a0d..65941f65bf8 100644
--- a/libsanitizer/asan/asan_errors.cc
+++ b/libsanitizer/asan/asan_errors.cc
@@ -123,9 +123,8 @@ void ErrorAllocTypeMismatch::Print() {
   Decorator d;
   Printf("%s", d.Error());
   Report("ERROR: AddressSanitizer: %s (%s vs %s) on %p\n",
-         scariness.GetDescription(),
-         alloc_names[alloc_type], dealloc_names[dealloc_type],
-         addr_description.addr);
+         scariness.GetDescription(), alloc_names[alloc_type],
+         dealloc_names[dealloc_type], addr_description.Address());
   Printf("%s", d.Default());
   CHECK_GT(dealloc_stack->size, 0);
   scariness.Print();
diff --git a/libsanitizer/asan/asan_errors.h b/libsanitizer/asan/asan_errors.h
index 5ed15dc9817..b155f2452af 100644
--- a/libsanitizer/asan/asan_errors.h
+++ b/libsanitizer/asan/asan_errors.h
@@ -108,8 +108,8 @@ struct ErrorFreeNotMalloced : ErrorBase {
 
 struct ErrorAllocTypeMismatch : ErrorBase {
   const BufferedStackTrace *dealloc_stack;
-  HeapAddressDescription addr_description;
   AllocType alloc_type, dealloc_type;
+  AddressDescription addr_description;
 
   ErrorAllocTypeMismatch() = default;  // (*)
   ErrorAllocTypeMismatch(u32 tid, BufferedStackTrace *stack, uptr addr,
@@ -117,9 +117,8 @@ struct ErrorAllocTypeMismatch : ErrorBase {
       : ErrorBase(tid, 10, "alloc-dealloc-mismatch"),
         dealloc_stack(stack),
         alloc_type(alloc_type_),
-        dealloc_type(dealloc_type_) {
-    GetHeapAddressInformation(addr, 1, &addr_description);
-  };
+        dealloc_type(dealloc_type_),
+        addr_description(addr, 1, false) {}
   void Print();
 };
 

Reply via email to