From 9749a90cc694e13f1bda251f2542c2962c64d4b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sa=C3=BAl=20Ibarra=20Corretg=C3=A9?= Date: Tue, 14 Nov 2023 10:05:23 +0100 Subject: [PATCH] Skip stack checks whenbuilding with ASAN --- CMakeLists.txt | 3 +++ quickjs.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) 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