1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-23 18:55:08 +00:00

LibJS: Don't emit a LeaveUnwindContext after a successful handler

The handler already comes with a nice and shiny FinishUnwind, doubling
up will leave two contexts instead.
This commit is contained in:
Ali Mohammad Pur 2022-02-12 00:32:18 +03:30 committed by Linus Groh
parent d7c207beb9
commit 3a5f7cb524

View file

@ -1152,8 +1152,6 @@ void TryStatement::generate_bytecode(Bytecode::Generator& generator) const
if (m_handler) {
auto& handler_block = generator.make_block();
generator.switch_to_basic_block(handler_block);
if (!m_finalizer)
generator.emit<Bytecode::Op::LeaveUnwindContext>();
m_handler->parameter().visit(
[&](FlyString const& parameter) {
if (!parameter.is_empty()) {