diff options
author | Florian Walch <florian@fwalch.com> | 2015-07-05 10:31:17 +0300 |
---|---|---|
committer | Florian Walch <florian@fwalch.com> | 2015-07-05 10:31:17 +0300 |
commit | 53053381674b1cca4c60c3657f31ea05fd935278 (patch) | |
tree | 235c42c492b3246c1abc6ac2a753d32a0d50924e /src | |
parent | 1d9501186c2e97c3ea9004e86ff6744fef9ef957 (diff) | |
parent | 24dc42e7e5829978abc132f2844e537244ba43bd (diff) | |
download | rneovim-53053381674b1cca4c60c3657f31ea05fd935278.tar.gz rneovim-53053381674b1cca4c60c3657f31ea05fd935278.tar.bz2 rneovim-53053381674b1cca4c60c3657f31ea05fd935278.zip |
Merge #2807 'Travis: Add Clang MSan/TSan builds'.
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/CMakeLists.txt | 16 | ||||
-rw-r--r-- | src/nvim/spell.c | 2 |
2 files changed, 14 insertions, 4 deletions
diff --git a/src/nvim/CMakeLists.txt b/src/nvim/CMakeLists.txt index 880ff42ba5..ad5bac1898 100644 --- a/src/nvim/CMakeLists.txt +++ b/src/nvim/CMakeLists.txt @@ -95,7 +95,7 @@ foreach(gen_cdef ${gen_cdefs} DO_NOT_DEFINE_EMPTY_ATTRIBUTES) list(APPEND gen_cflags "-D${gen_cdef}") endif() endforeach() -if (SANITIZE) +if(CLANG_ASAN_UBSAN OR CLANG_MSAN OR CLANG_TSAN) list(APPEND gen_cflags "-DEXITFREE") endif() @@ -190,11 +190,21 @@ add_executable(nvim ${NEOVIM_GENERATED_SOURCES} ${NEOVIM_SOURCES} target_link_libraries(nvim ${NVIM_EXEC_LINK_LIBRARIES}) install_helper(TARGETS nvim) -if(SANITIZE) - message(STATUS "Enabling Clang sanitizers for nvim") +if(CLANG_ASAN_UBSAN) + message(STATUS "Enabling Clang address sanitizer and undefined behavior sanitizer for nvim.") set_property(TARGET nvim APPEND_STRING PROPERTY COMPILE_FLAGS "-DEXITFREE ") set_property(TARGET nvim APPEND_STRING PROPERTY COMPILE_FLAGS "-fno-sanitize-recover -fno-omit-frame-pointer -fno-optimize-sibling-calls -fsanitize=address -fsanitize=undefined ") set_property(TARGET nvim APPEND_STRING PROPERTY LINK_FLAGS "-fsanitize=address -fsanitize=undefined ") +elseif(CLANG_MSAN) + message(STATUS "Enabling Clang memory sanitizer for nvim.") + set_property(TARGET nvim APPEND_STRING PROPERTY COMPILE_FLAGS "-DEXITFREE ") + set_property(TARGET nvim APPEND_STRING PROPERTY COMPILE_FLAGS "-fsanitize=memory -fsanitize-memory-track-origins -fno-omit-frame-pointer -fno-optimize-sibling-calls ") + set_property(TARGET nvim APPEND_STRING PROPERTY LINK_FLAGS "-fsanitize=memory -fsanitize-memory-track-origins ") +elseif(CLANG_TSAN) + message(STATUS "Enabling Clang thread sanitizer for nvim.") + set_property(TARGET nvim APPEND_STRING PROPERTY COMPILE_FLAGS "-DEXITFREE ") + set_property(TARGET nvim APPEND_STRING PROPERTY COMPILE_FLAGS "-fsanitize=thread ") + set_property(TARGET nvim APPEND_STRING PROPERTY LINK_FLAGS "-fsanitize=thread ") endif() add_library(libnvim STATIC EXCLUDE_FROM_ALL ${NEOVIM_GENERATED_SOURCES} diff --git a/src/nvim/spell.c b/src/nvim/spell.c index 63fc7b80a7..f312670a96 100644 --- a/src/nvim/spell.c +++ b/src/nvim/spell.c @@ -4116,7 +4116,7 @@ static int badword_captype(char_u *word, char_u *end) // Delete the internal wordlist and its .spl file. void spell_delete_wordlist(void) { - char_u fname[MAXPATHL]; + char_u fname[MAXPATHL] = {0}; if (int_wordlist != NULL) { os_remove((char *)int_wordlist); |