diff --git a/CMakeLists.txt b/CMakeLists.txt index 66ad2dc..11b2e2c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -165,10 +165,6 @@ endif() if(CONFIG_UBSAN) message(STATUS "Building with UBSan") -# __has_feature(undefined_sanitizer) or __SANITIZE_UNDEFINED__ don't exist -add_compile_definitions( - __UBSAN__=1 -) add_compile_options( -fsanitize=undefined -fno-sanitize-recover=all diff --git a/cutils.h b/cutils.h index 4ad3f64..ea22834 100644 --- a/cutils.h +++ b/cutils.h @@ -54,14 +54,6 @@ extern "C" { #include #endif -#if defined(__SANITIZE_ADDRESS__) -# define __ASAN__ 1 -#elif defined(__has_feature) -# if __has_feature(address_sanitizer) -# define __ASAN__ 1 -# endif -#endif - #if defined(_MSC_VER) && !defined(__clang__) # define likely(x) (x) # define unlikely(x) (x) diff --git a/qjs.c b/qjs.c index 8671ffb..a4851bd 100644 --- a/qjs.c +++ b/qjs.c @@ -208,9 +208,6 @@ static const JSCFunctionListEntry navigator_proto_funcs[] = { static const JSCFunctionListEntry global_obj[] = { JS_CFUNC_DEF("gc", 0, js_gc), -#if defined(__ASAN__) || defined(__UBSAN__) - JS_PROP_INT32_DEF("__running_with_sanitizer__", 1, JS_PROP_C_W_E ), -#endif }; /* also used to initialize the worker context */ diff --git a/quickjs.c b/quickjs.c index d0ca626..984ab45 100644 --- a/quickjs.c +++ b/quickjs.c @@ -2517,7 +2517,7 @@ JSRuntime *JS_GetRuntime(JSContext *ctx) static void update_stack_limit(JSRuntime *rt) { -#if defined(__wasi__) || (defined(__ASAN__) && !defined(NDEBUG)) +#if defined(__wasi__) rt->stack_limit = 0; /* no limit */ #else if (rt->stack_size == 0) { diff --git a/tests/bug775.js b/tests/bug775.js new file mode 100644 index 0000000..4cb9387 --- /dev/null +++ b/tests/bug775.js @@ -0,0 +1,7 @@ +/*--- +negative: + phase: runtime + type: RangeError +---*/ +function f() { f() } // was problematic under ASan +f() diff --git a/tests/bug776.js b/tests/bug776.js new file mode 100644 index 0000000..4b092c2 --- /dev/null +++ b/tests/bug776.js @@ -0,0 +1,7 @@ +/*--- +negative: + phase: runtime + type: RangeError +---*/ +function f() { f.apply(null) } // was problematic under ASan +f() diff --git a/tests/test_std.js b/tests/test_std.js index 0f70c6d..4603590 100644 --- a/tests/test_std.js +++ b/tests/test_std.js @@ -258,8 +258,6 @@ function test_timeout() function test_timeout_order() { - if (globalThis.__running_with_sanitizer__) return; - var s = ""; os.setTimeout(a, 0); os.setTimeout(b, 100);