Merge pull request #421 from libexpat/leaksan

qa.sh: Enable LeakSanitizer
This commit is contained in:
Sebastian Pipping 2020-09-26 01:36:42 +02:00 committed by GitHub
commit 006603972e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -57,6 +57,11 @@ populate_environment() {
# http://clang.llvm.org/docs/AddressSanitizer.html
BASE_COMPILE_FLAGS+=" -g -fsanitize=address -fno-omit-frame-pointer -fno-common"
BASE_LINK_FLAGS+=" -g -fsanitize=address"
# macOS's XCode does not support LeakSanitizer and reports error:
# AddressSanitizer: detect_leaks is not supported on this platform.
if [[ "$(uname -s)" != Darwin* ]]; then
export ASAN_OPTIONS=detect_leaks=1
fi
;;
memory)
# http://clang.llvm.org/docs/MemorySanitizer.html