Browse Source

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.
Ali Mohammad Pur 3 năm trước cách đây
mục cha
commit
3a5f7cb524
1 tập tin đã thay đổi với 0 bổ sung2 xóa
  1. 0 2
      Userland/Libraries/LibJS/Bytecode/ASTCodegen.cpp

+ 0 - 2
Userland/Libraries/LibJS/Bytecode/ASTCodegen.cpp

@@ -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()) {