[libcxx] r341671 - [asan] Update a vector's storage annotation during destruction. Reviewed as https://reviews.llvm.org/D50101. Thanks to bobsayshilol (Ben) for the patch.

Marshall Clow via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 7 08:47:59 PDT 2018


Author: marshall
Date: Fri Sep  7 08:47:59 2018
New Revision: 341671

URL: http://llvm.org/viewvc/llvm-project?rev=341671&view=rev
Log:
[asan] Update a vector's storage annotation during destruction. Reviewed as https://reviews.llvm.org/D50101. Thanks to bobsayshilol (Ben) for the patch.

Modified:
    libcxx/trunk/include/vector

Modified: libcxx/trunk/include/vector
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/vector?rev=341671&r1=341670&r2=341671&view=diff
==============================================================================
--- libcxx/trunk/include/vector (original)
+++ libcxx/trunk/include/vector Fri Sep  7 08:47:59 2018
@@ -540,13 +540,14 @@ public:
                                     value_type,
                                     typename iterator_traits<_ForwardIterator>::reference>::value>::type* = 0);
 
-#if _LIBCPP_DEBUG_LEVEL >= 2
     _LIBCPP_INLINE_VISIBILITY
     ~vector()
     {
+        __annotate_delete();
+#if _LIBCPP_DEBUG_LEVEL >= 2
         __get_db()->__erase_c(this);
-    }
 #endif
+    }
 
     vector(const vector& __x);
     vector(const vector& __x, const allocator_type& __a);




More information about the cfe-commits mailing list