From a58aa661ffeb21a934a7f8a751d712f4e9beb168 Mon Sep 17 00:00:00 2001 From: Marcel Greter Date: Fri, 15 Apr 2016 19:41:56 +0200 Subject: [PATCH] Enable address sanitizer for clang --- script/ci-build-libsass | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/script/ci-build-libsass b/script/ci-build-libsass index f7c221324c..ac56b1fe2c 100755 --- a/script/ci-build-libsass +++ b/script/ci-build-libsass @@ -48,6 +48,18 @@ if [ "x$PREFIX" == "x" ]; then fi fi +# enable address sanitation +# https://en.wikipedia.org/wiki/AddressSanitizer +if [ "x$CC" == "xclang" ]; then + if [ "x$COVERAGE" != "xyes" ]; then + if [ "$TRAVIS_OS_NAME" == "linux" ]; then + export EXTRA_CFLAGS="$EXTRA_CFLAGS -fsanitize=address" + export EXTRA_CXXFLAGS="$EXTRA_CXXFLAGS -fsanitize=address" + export EXTRA_LDFLAGS="$EXTRA_LDFLAGS -fsanitize=address" + fi + fi +fi + echo SASS_LIBSASS_PATH: $SASS_LIBSASS_PATH echo TRAVIS_BUILD_DIR: $TRAVIS_BUILD_DIR echo SASS_SASSC_PATH: $SASS_SASSC_PATH