Disable alignment sanitizer in undefined behaviour sanitizer
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
673bd58b88
commit
3739b0bb66
|
@ -228,9 +228,14 @@ if (PKMNLIB_TESTS)
|
||||||
# Add a definition for the test library
|
# Add a definition for the test library
|
||||||
target_compile_definitions(pkmnLibTests PRIVATE TESTS_BUILD)
|
target_compile_definitions(pkmnLibTests PRIVATE TESTS_BUILD)
|
||||||
if (SANITIZER_TESTS AND NOT WINDOWS)
|
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)
|
# Turn on a set of standard sanitizers
|
||||||
target_compile_options(pkmnLibTests PRIVATE -fsanitize=address,undefined,leak,integer,nullability -fno-sanitize-recover=all)
|
# We don't want to recover from any sanitizer error
|
||||||
target_link_options(pkmnLibTests PRIVATE -fsanitize=address,undefined,leak,integer,nullability -fno-sanitize-recover=all)
|
# 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 ()
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#include "ConstString.hpp"
|
#include "ConstString.hpp"
|
||||||
#include <Arbutils/StringView.hpp>
|
|
||||||
#include <Arbutils/Ensure.hpp>
|
#include <Arbutils/Ensure.hpp>
|
||||||
|
#include <Arbutils/StringView.hpp>
|
||||||
|
|
||||||
static void ConstructConstString(void* self) { new (self) ArbUt::StringView(); }
|
static void ConstructConstString(void* self) { new (self) ArbUt::StringView(); }
|
||||||
static void ConstructConstStringFromStd(void* self, const std::string& s) {
|
static void ConstructConstStringFromStd(void* self, const std::string& s) {
|
||||||
|
|
Loading…
Reference in New Issue