mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-30 20:59:16 +00:00
LibJS/Bytecode: Unwind to closest unwind boundary on Throw
This will leave any lexical/variable environments on the way to the closest unwind context boundary. This will not leave the closest unwind context, as we still need the unwind context to perform the Throw instruction correctly.
This commit is contained in:
parent
858bcac4c7
commit
9f4cc6435d
Notes:
sideshowbarker
2024-07-17 17:27:05 +09:00
Author: https://github.com/Lubrsi
Commit: 9f4cc6435d
Pull-request: https://github.com/SerenityOS/serenity/pull/13039
Reviewed-by: https://github.com/davidot
2 changed files with 3 additions and 0 deletions
|
@ -1441,6 +1441,7 @@ Bytecode::CodeGenerationErrorOr<void> UpdateExpression::generate_bytecode(Byteco
|
|||
Bytecode::CodeGenerationErrorOr<void> ThrowStatement::generate_bytecode(Bytecode::Generator& generator) const
|
||||
{
|
||||
TRY(m_argument->generate_bytecode(generator));
|
||||
generator.perform_needed_unwinds<Bytecode::Op::Throw>();
|
||||
generator.emit<Bytecode::Op::Throw>();
|
||||
return {};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue