diff --git a/CMakeLists.txt b/CMakeLists.txt index 3aa4707..361563c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -228,9 +228,14 @@ if (PKMNLIB_TESTS) # Add a definition for the test library target_compile_definitions(pkmnLibTests PRIVATE TESTS_BUILD) if (SANITIZER_TESTS AND NOT WINDOWS) - target_compile_options(pkmnLib PRIVATE -fsanitize=address,undefined,leak,integer,nullability -fno-sanitize-recover=all -fno-sanitize=unsigned-integer-overflow) - target_compile_options(pkmnLibTests PRIVATE -fsanitize=address,undefined,leak,integer,nullability -fno-sanitize-recover=all) - target_link_options(pkmnLibTests PRIVATE -fsanitize=address,undefined,leak,integer,nullability -fno-sanitize-recover=all) + # Turn on a set of standard sanitizers + # We don't want to recover from any sanitizer error + # Except unsigned overflows (often used in standard libraries etc) + # Except alignment (Angelscript aligns data wrong when allocating, and I don't have the time to fix Angelscripts allocation.) + SET(SANITIZER_OPTS -fsanitize=address,undefined,leak,integer,nullability -fno-sanitize-recover=all -fno-sanitize=unsigned-integer-overflow -fsanitize-recover=alignment) + target_compile_options(pkmnLib PRIVATE ${SANITIZER_OPTS}) + target_compile_options(pkmnLibTests PRIVATE ${SANITIZER_OPTS}) + target_link_options(pkmnLibTests PRIVATE ${SANITIZER_OPTS}) endif () endif () diff --git a/src/ScriptResolving/AngelScript/TypeRegistry/ConstString.cpp b/src/ScriptResolving/AngelScript/TypeRegistry/ConstString.cpp index e73bb9b..6edf2b7 100644 --- a/src/ScriptResolving/AngelScript/TypeRegistry/ConstString.cpp +++ b/src/ScriptResolving/AngelScript/TypeRegistry/ConstString.cpp @@ -1,6 +1,6 @@ #include "ConstString.hpp" -#include #include +#include static void ConstructConstString(void* self) { new (self) ArbUt::StringView(); } static void ConstructConstStringFromStd(void* self, const std::string& s) {