[libcxx-commits] [PATCH] D146815: [ASan][libc++] Annotating std::deque with all allocators

Tacet via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Jun 1 17:56:45 PDT 2023


AdvenamTacet updated this revision to Diff 527685.
AdvenamTacet added a comment.

This update applies changes to the newest version of D132092 <https://reviews.llvm.org/D132092>.
It also adds tests similar to those in D136765 <https://reviews.llvm.org/D136765>.

I have a problem with local tests.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D146815/new/

https://reviews.llvm.org/D146815

Files:
  libcxx/include/deque


Index: libcxx/include/deque
===================================================================
--- libcxx/include/deque
+++ libcxx/include/deque
@@ -457,9 +457,6 @@
 template <class _Tp, class _Allocator /*= allocator<_Tp>*/>
 class _LIBCPP_TEMPLATE_VIS deque
 {
-private:
-  using __default_allocator_type = allocator<_Tp>;
-
 public:
     // types:
 
@@ -980,7 +977,7 @@
         const void* __old_con_end,
         const void* __new_con_beg,
         const void* __new_con_end) const {
-        if (__beg && is_same<allocator_type, __default_allocator_type>::value)
+        if (__beg != nullptr && __asan_annotate_container_with_allocator<_Allocator>::value)
             __sanitizer_annotate_double_ended_contiguous_container(
                 __beg, __end, __old_con_beg, __old_con_end, __new_con_beg, __new_con_end);
     }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D146815.527685.patch
Type: text/x-patch
Size: 832 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20230602/80263b56/attachment.bin>


More information about the libcxx-commits mailing list