From 6ffc8f389e76d8358a8829948dd20f2a5603c8bc Mon Sep 17 00:00:00 2001 From: Linus Groh Date: Sun, 5 Sep 2021 20:34:06 +0100 Subject: [PATCH] LibJS: Use different stack space limit values for with and without ASAN Instead of having a single limit here, which we had to increase once to work with ASAN enabled, check whether HAS_ADDRESS_SANITIZER is defined and use 32 KiB, and 16 KiB otherwise (which is what we used previously). This idea is shamelessly stolen from V8: https://github.com/v8/v8/blob/b2b44af/src/execution/isolate.cc#L1381-L1387 --- Userland/Libraries/LibJS/Runtime/VM.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Userland/Libraries/LibJS/Runtime/VM.h b/Userland/Libraries/LibJS/Runtime/VM.h index 579f5dbdc3..5f8c4e1a72 100644 --- a/Userland/Libraries/LibJS/Runtime/VM.h +++ b/Userland/Libraries/LibJS/Runtime/VM.h @@ -107,8 +107,11 @@ public: bool did_reach_stack_space_limit() const { - // Note: the 32 kiB used to be 16 kiB, but that turned out to not be enough with ASAN enabled. +#ifdef HAS_ADDRESS_SANITIZER return m_stack_info.size_free() < 32 * KiB; +#else + return m_stack_info.size_free() < 16 * KiB; +#endif } void push_execution_context(ExecutionContext& context, GlobalObject& global_object)