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
This commit is contained in:
Linus Groh 2021-09-05 20:34:06 +01:00
parent 941ff0cf60
commit 6ffc8f389e
Notes: sideshowbarker 2024-07-18 04:39:51 +09:00

View file

@ -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)