Cherry pick libsanitizer patch (https://reviews.llvm.org/D54856). 31/202431/1 accepted/tizen/base/20190402.084601 submit/tizen_base/20190329.012305
authormarxin <marxin@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 27 Dec 2018 09:47:20 +0000 (09:47 +0000)
committerMikhail Kashkarov <m.kashkarov@partner.samsung.com>
Thu, 28 Mar 2019 10:42:23 +0000 (13:42 +0300)
2018-12-27  Martin Liska  <mliska@suse.cz>

  PR sanitizer/86229
* asan/asan_errors.cc (ErrorAllocTypeMismatch::Print): Cherry
pick rL350085.
* asan/asan_errors.h (struct ErrorAllocTypeMismatch): Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@267432 138bc75d-0d04-0410-961f-82ee72b054a4

(cherry picked from commit 27e7ab5c4e8aa2c89a5e9b91d1b4eb60a435b14f)

Change-Id: I016920774a6215f7a638cab88f268baeff049601

libsanitizer/ChangeLog
libsanitizer/asan/asan_errors.cc
libsanitizer/asan/asan_errors.h

index 3578de6..3057e75 100644 (file)
@@ -1,3 +1,10 @@
+2018-12-27  Martin Liska  <mliska@suse.cz>
+
+  PR sanitizer/86229
+       * asan/asan_errors.cc (ErrorAllocTypeMismatch::Print): Cherry
+       pick rL350085.
+       * asan/asan_errors.h (struct ErrorAllocTypeMismatch): Likewise.
+
 2018-06-13  Denis Khalikov  <d.khalikov@partner.samsung.com>
 
        PR sanitizer/86090
index 73c4cca..ec05bd7 100644 (file)
@@ -151,7 +151,7 @@ void ErrorAllocTypeMismatch::Print() {
   Printf("%s", d.Warning());
   Report("ERROR: AddressSanitizer: alloc-dealloc-mismatch (%s vs %s) on %p\n",
          alloc_names[alloc_type], dealloc_names[dealloc_type],
-         addr_description.addr);
+         addr_description.Address());
   Printf("%s", d.EndWarning());
   CHECK_GT(dealloc_stack->size, 0);
   scariness.Print();
index 6262dcf..1ffd994 100644 (file)
@@ -140,8 +140,8 @@ struct ErrorFreeNotMalloced : ErrorBase {
 struct ErrorAllocTypeMismatch : ErrorBase {
   // ErrorAllocTypeMismatch doesn't own the stack trace.
   const BufferedStackTrace *dealloc_stack;
-  HeapAddressDescription addr_description;
   AllocType alloc_type, dealloc_type;
+  AddressDescription addr_description;
   // VS2013 doesn't implement unrestricted unions, so we need a trivial default
   // constructor
   ErrorAllocTypeMismatch() = default;
@@ -150,8 +150,8 @@ struct ErrorAllocTypeMismatch : ErrorBase {
       : ErrorBase(tid),
         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) {
     scariness.Clear();
     scariness.Scare(10, "alloc-dealloc-mismatch");
   };