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:
parent
941ff0cf60
commit
6ffc8f389e
Notes:
sideshowbarker
2024-07-18 04:39:51 +09:00
Author: https://github.com/linusg Commit: https://github.com/SerenityOS/serenity/commit/6ffc8f389e7 Pull-request: https://github.com/SerenityOS/serenity/pull/9842 Reviewed-by: https://github.com/IdanHo ✅
1 changed files with 4 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue