diff --git a/util/misc/initialization_state_test.cc b/util/misc/initialization_state_test.cc index f3681173..d6b96ced 100644 --- a/util/misc/initialization_state_test.cc +++ b/util/misc/initialization_state_test.cc @@ -18,6 +18,7 @@ #include +#include "base/compiler_specific.h" #include "base/memory/free_deleter.h" #include "gtest/gtest.h" @@ -59,6 +60,10 @@ TEST(InitializationState, InitializationState) { // buffer that’s still valid and its destructor was called directly, this // approximates use-after-free without risking that the memory formerly used // for the InitializationState object has been repurposed. + + // (Though this is still UB and MSan does not like this) + MSAN_UNPOISON(initialization_state, sizeof(*initialization_state)); + EXPECT_FALSE(initialization_state->is_uninitialized()); EXPECT_FALSE(initialization_state->is_valid()); }