mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-21 09:49:21 +00:00
LibJS: Mark stack overflow exception code path as [[unlikely]]
This is supposed to be exceedingly rare, so a great candidate for [[unlikely]] annotation.
This commit is contained in:
parent
580b892b9e
commit
6ec4d0f5ba
Notes:
github-actions[bot]
2025-04-28 14:40:51 +00:00
Author: https://github.com/awesomekling
Commit: 6ec4d0f5ba
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4502
1 changed files with 2 additions and 1 deletions
|
@ -112,8 +112,9 @@ public:
|
||||||
ThrowCompletionOr<void> push_execution_context(ExecutionContext& context, CheckStackSpaceLimitTag)
|
ThrowCompletionOr<void> push_execution_context(ExecutionContext& context, CheckStackSpaceLimitTag)
|
||||||
{
|
{
|
||||||
// Ensure we got some stack space left, so the next function call doesn't kill us.
|
// 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<InternalError>(ErrorType::CallStackSizeExceeded);
|
return throw_completion<InternalError>(ErrorType::CallStackSizeExceeded);
|
||||||
|
}
|
||||||
push_execution_context(context);
|
push_execution_context(context);
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue