diff --git a/CMakeLists.txt b/CMakeLists.txt index 91871dfa..2a053704 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -56,8 +56,7 @@ if(SANITIZERS) add_definitions(/_MSVC_STL_HARDENING=1 /_MSVC_STL_DESTRUCTOR_TOMBSTONES=1 /D_ITERATOR_DEBUG_LEVEL=2) else() # We assume a GNU-like compiler. message(STATUS "ASan and UBSan enabled") - set(SAN_FLAGS -fsanitize=address -fsanitize=undefined - -fsanitize=float-divide-by-zero) + set(SAN_FLAGS -fsanitize=address,undefined,float-divide-by-zero,float-cast-overflow,pointer-compare,pointer-subtract) add_compile_options(${SAN_FLAGS}) add_link_options(${SAN_FLAGS}) # Consider using `_GLIBCXX_DEBUG_BACKTRACE` (and `-lstdc++exp`) if unable to debug locally. diff --git a/Makefile b/Makefile index e9bcc114..1c492bad 100644 --- a/Makefile +++ b/Makefile @@ -232,7 +232,7 @@ develop: -D_GLIBCXX_DEBUG -D_GLIBCXX_DEBUG_PEDANTIC -D_GLIBCXX_SANITIZE_VECTOR \ -D_GLIBCXX_VERBOSE_ASSERT -D_GLIBCXX_EXTERN_TEMPLATE=0 \ -D_LIBCPP_DEBUG -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_DEBUG \ - -fsanitize=address -fsanitize=undefined -fsanitize=float-divide-by-zero \ + -fsanitize=address,undefined,float-divide-by-zero,float-cast-overflow,pointer-compare,pointer-subtract \ ${WARNFLAGS}" \ CXXFLAGS="-ggdb3 -Og -fno-omit-frame-pointer -fno-optimize-sibling-calls ${CXXFLAGS}" diff --git a/src/version.cpp b/src/version.cpp index 06577fc8..5c8f139c 100644 --- a/src/version.cpp +++ b/src/version.cpp @@ -17,7 +17,7 @@ extern "C" { char const *__asan_default_options(void) { return ":check_initialization_order=1" - ":detect_invalid_pointer_pairs=2" + ":detect_invalid_pointer_pairs=0" // Avoid false positives // `detect_leaks` is not supported on macOS. #ifndef __APPLE__ ":detect_leaks=1"