[libcxx-commits] [libcxx] Poison memory in variant destroy (PR #101048)

via libcxx-commits libcxx-commits at lists.llvm.org
Mon Jul 29 11:02:32 PDT 2024


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff b7ed097f29d712b1cc839e15ab68d2c8a2ce07cc af5ed533be2fd1729221579e12a081a7f396d8d6 --extensions  -- libcxx/include/variant
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/libcxx/include/variant b/libcxx/include/variant
index 41c946fc967..30a82082a5d 100644
--- a/libcxx/include/variant
+++ b/libcxx/include/variant
@@ -262,7 +262,7 @@ namespace std {
 #include <version>
 
 #if __has_feature(memory_sanitizer)
-#include <sanitizer/msan_interface.h>
+#  include <sanitizer/msan_interface.h>
 #endif
 
 // standard-mandated includes
@@ -785,9 +785,9 @@ _LIBCPP_VARIANT_DESTRUCTOR(
     _Trait::_TriviallyAvailable,
     _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 ~__dtor() = default,
     _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void __destroy() noexcept {
-#if __has_feature(memory_sanitizer)
+#  if __has_feature(memory_sanitizer)
       __sanitizer_dtor_callback(&this->__data, sizeof(this->__data));
-#endif
+#  endif
       this->__index = __variant_npos<__index_t>;
     } _LIBCPP_EAT_SEMICOLON);
 

``````````

</details>


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


More information about the libcxx-commits mailing list