mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-01 05:39:11 +00:00
LibWasm+LibWeb: Throw a js stack-overflow error if wasm stack overflows
Follows the spec.
This commit is contained in:
parent
9ae85e5c68
commit
39b637a446
Notes:
github-actions[bot]
2025-05-22 06:37:26 +00:00
Author: https://github.com/alimpfard
Commit: 39b637a446
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4833
Reviewed-by: https://github.com/ADKaster
Reviewed-by: https://github.com/tcl3 ✅
4 changed files with 20 additions and 4 deletions
|
@ -89,6 +89,14 @@ protected:
|
|||
return !m_trap.has<Empty>();
|
||||
}
|
||||
|
||||
template<typename... Rest>
|
||||
ALWAYS_INLINE bool trap_if_not(bool value, StringView reason, CheckedFormatString<StringView, Rest...> format, Rest const&... args)
|
||||
{
|
||||
if (!value)
|
||||
m_trap = Trap { ByteString::formatted(move(format), reason, args...) };
|
||||
return !m_trap.has<Empty>();
|
||||
}
|
||||
|
||||
Variant<Trap, Empty> m_trap;
|
||||
StackInfo const& m_stack_info;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue