diff --git a/CMakeLists.txt b/CMakeLists.txt index 0863da4..ac7e2dc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -58,6 +58,9 @@ option(CONFIG_UBSAN "Enable UndefinedBehaviorSanitizer (UBSan)" OFF) if(CONFIG_ASAN) message(STATUS "Building with ASan") +add_compile_definitions( + __ASAN__=1 +) add_compile_options( -fsanitize=address -fno-sanitize-recover=all diff --git a/quickjs.c b/quickjs.c index 0f41cef..3c10351 100644 --- a/quickjs.c +++ b/quickjs.c @@ -65,7 +65,7 @@ #define CONFIG_PRINTF_RNDN #endif -#if !defined(EMSCRIPTEN) +#if !defined(EMSCRIPTEN) && !defined(__ASAN__) /* enable stack limitation */ #define CONFIG_STACK_CHECK #endif