[libcxx-commits] [libcxx] [ASan][libc++] Update string ASan annotations to Zero-overhead (PR #76165)

via libcxx-commits libcxx-commits at lists.llvm.org
Thu Dec 21 08:56:40 PST 2023


================
@@ -936,12 +949,12 @@ public:
     else {
       if (__libcpp_is_constant_evaluated())
         __r_.first() = __rep();
-      if (!__str.__is_long())
+      _IF_ASAN() if (!__str.__is_long())
         __str.__annotate_delete();
       __r_.first()       = __str.__r_.first();
       __str.__r_.first() = __rep();
-      __str.__annotate_new(0);
-      if (!__is_long() && this != &__str)
+      _IF_ASAN() __str.__annotate_new(0);
+      _IF_ASAN() if (!__is_long() && this != &__str)
----------------
EricWF wrote:

Just use a single block here and wrap it in ` { ... }`.

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


More information about the libcxx-commits mailing list