1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 06:27:45 +00:00

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:
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

View file

@ -107,8 +107,11 @@ public:
bool did_reach_stack_space_limit() const 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; 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) void push_execution_context(ExecutionContext& context, GlobalObject& global_object)