diff --git a/Userland/Libraries/LibJS/Bytecode/ASTCodegen.cpp b/Userland/Libraries/LibJS/Bytecode/ASTCodegen.cpp index e6c2f43bff..9c44e22e15 100644 --- a/Userland/Libraries/LibJS/Bytecode/ASTCodegen.cpp +++ b/Userland/Libraries/LibJS/Bytecode/ASTCodegen.cpp @@ -850,7 +850,6 @@ Bytecode::CodeGenerationErrorOr> ForStatement::gener Bytecode::BasicBlock* test_block_ptr { nullptr }; Bytecode::BasicBlock* body_block_ptr { nullptr }; Bytecode::BasicBlock* update_block_ptr { nullptr }; - Bytecode::BasicBlock* load_result_and_jump_to_end_block_ptr { nullptr }; auto& end_block = generator.make_block(); @@ -901,14 +900,13 @@ Bytecode::CodeGenerationErrorOr> ForStatement::gener generator.emit(Bytecode::Label { *test_block_ptr }); if (m_test) { - load_result_and_jump_to_end_block_ptr = &generator.make_block(); generator.switch_to_basic_block(*test_block_ptr); auto test = TRY(m_test->generate_bytecode(generator)).value(); generator.emit( test, Bytecode::Label { *body_block_ptr }, - Bytecode::Label { *load_result_and_jump_to_end_block_ptr }); + Bytecode::Label { end_block }); } if (m_update) { @@ -933,11 +931,6 @@ Bytecode::CodeGenerationErrorOr> ForStatement::gener } } - if (load_result_and_jump_to_end_block_ptr) { - generator.switch_to_basic_block(*load_result_and_jump_to_end_block_ptr); - generator.emit(Bytecode::Label { end_block }); - } - generator.switch_to_basic_block(end_block); if (has_lexical_environment)