From 6ec4d0f5ba322f5a10520853e47a7fe945e3dd40 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Mon, 28 Apr 2025 01:55:08 +0200 Subject: [PATCH] LibJS: Mark stack overflow exception code path as [[unlikely]] This is supposed to be exceedingly rare, so a great candidate for [[unlikely]] annotation. --- Libraries/LibJS/Runtime/VM.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Libraries/LibJS/Runtime/VM.h b/Libraries/LibJS/Runtime/VM.h index e2666dd6492..31c6c4cfad8 100644 --- a/Libraries/LibJS/Runtime/VM.h +++ b/Libraries/LibJS/Runtime/VM.h @@ -112,8 +112,9 @@ public: ThrowCompletionOr push_execution_context(ExecutionContext& context, CheckStackSpaceLimitTag) { // Ensure we got some stack space left, so the next function call doesn't kill us. - if (did_reach_stack_space_limit()) + if (did_reach_stack_space_limit()) [[unlikely]] { return throw_completion(ErrorType::CallStackSizeExceeded); + } push_execution_context(context); return {}; }