[libcxx-commits] [libcxx] [ASan][libc++] Annotating `std::basic_string` with all allocators (PR #75845)

via libcxx-commits libcxx-commits at lists.llvm.org
Wed Dec 27 00:18:46 PST 2023


================
@@ -1891,8 +1891,7 @@ private:
 #if !defined(_LIBCPP_HAS_NO_ASAN) && defined(_LIBCPP_INSTRUMENTED_WITH_ASAN)
     const void* __begin = data();
     const void* __end   = data() + capacity() + 1;
-    if (!__libcpp_is_constant_evaluated() && __begin != nullptr &&
-        is_same<allocator_type, __default_allocator_type>::value)
+    if (!__libcpp_is_constant_evaluated() && __asan_annotate_container_with_allocator<allocator_type>::value)
----------------
AdvenamTacet wrote:

It can tolerate unpoisoned memory where it should be poisoned, not the other way around. It may result in some false negatives, but we accept that.

https://github.com/llvm/llvm-project/pull/75845


More information about the libcxx-commits mailing list