File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -235,12 +235,9 @@ file(GLOB XTENSOR_PREPROCESS_FILES files/cppy_source/*.cppy)
235235include (${CMAKE_SOURCE_DIR} /cmake/sanitizers.cmake )
236236
237237if (USE_SANITIZER MATCHES "memory" AND CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
238- set (XTENSOR_MSAN_IGNORELIST_FILE "${CMAKE_CURRENT_SOURCE_DIR} /msan_ignorelist.txt" )
239- set_source_files_properties (
240- main.cpp
241- PROPERTIES
242- COMPILE_OPTIONS "-fsanitize-ignorelist=${XTENSOR_MSAN_IGNORELIST_FILE} "
243- )
238+ # doctest's String union triggers MSan false positives during
239+ # static-init reporter registration. Fixed in main.cpp with
240+ # __attribute__((no_sanitize("memory"))) on doctest functions.
244241endif ()
245242
246243# This target should only be run when the test source files have been changed.
Original file line number Diff line number Diff line change 1+ #ifdef __clang__
2+ #if __has_feature(memory_sanitizer)
3+ // Suppress MSan false positives in doctest's String union comparison.
4+ // doctest::String uses a union of stack/heap storage; the padding
5+ // between union members is flagged as uninitialized during strcmp
6+ // inside reporter registration at static-init time.
7+ // no_sanitize("memory") suppresses the check while still allowing
8+ // shadow memory propagation for stores.
9+ #pragma clang attribute push(__attribute__((no_sanitize("memory"))), apply_to = function)
10+ #endif
11+ #endif
12+
113#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN
214#if defined(XTENSOR_DISABLE_EXCEPTIONS)
315#define DOCTEST_CONFIG_NO_EXCEPTIONS_BUT_WITH_ALL_ASSERTS
416#endif
517#include " doctest/doctest.h"
18+
19+ #ifdef __clang__
20+ #if __has_feature(memory_sanitizer)
21+ #pragma clang attribute pop
22+ #endif
23+ #endif
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments