diff --git a/Userland/Libraries/LibJS/Bytecode/Pass/MergeBlocks.cpp b/Userland/Libraries/LibJS/Bytecode/Pass/MergeBlocks.cpp index 89cdcd28d2..3301614436 100644 --- a/Userland/Libraries/LibJS/Bytecode/Pass/MergeBlocks.cpp +++ b/Userland/Libraries/LibJS/Bytecode/Pass/MergeBlocks.cpp @@ -36,7 +36,8 @@ void MergeBlocks::perform(PassPipelineExecutable& executable) if (entry.key->terminator()->type() != Instruction::Type::Jump) continue; - { + // NOTE: We can't replace the first block in a function, as it's the entry block. + if (entry.key != executable.executable.basic_blocks.first()) { InstructionStreamIterator it { entry.key->instruction_stream() }; auto& first_instruction = *it; if (first_instruction.type() == Instruction::Type::Jump) {