Skip to content

Commit 2f0cd21

Browse files
committed
[CMake] Fix error: invalid value 'address -sanitize=undefined' in '-sanitize='
Currently, when having both ASan and UBSan enabled, the compiler is passed "-sanitize=address -sanitize=undefined" which results in error: invalid value 'address -sanitize=undefined' in '-sanitize='. Pass the two flags separately to fix the issue.
1 parent 5a006d2 commit 2f0cd21

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cmake/modules/AddSwift.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ function(_add_host_variant_swift_sanitizer_flags target)
9696
# Not supported
9797
elseif(LLVM_USE_SANITIZER STREQUAL "Address;Undefined" OR
9898
LLVM_USE_SANITIZER STREQUAL "Undefined;Address")
99-
set(_Swift_SANITIZER_FLAGS "-sanitize=address -sanitize=undefined")
99+
set(_Swift_SANITIZER_FLAGS "-sanitize=address" "-sanitize=undefined")
100100
elseif(LLVM_USE_SANITIZER STREQUAL "Leaks")
101101
# Not supported
102102
else()

0 commit comments

Comments
 (0)