diff --git a/Userland/Libraries/LibJS/Bytecode/Op.h b/Userland/Libraries/LibJS/Bytecode/Op.h index cd42dd7d20a241..ea1e2bdb8bc6d2 100644 --- a/Userland/Libraries/LibJS/Bytecode/Op.h +++ b/Userland/Libraries/LibJS/Bytecode/Op.h @@ -795,6 +795,8 @@ class FinishUnwind final : public Instruction { String to_string_impl(Bytecode::Executable const&) const; void replace_references_impl(BasicBlock const&, BasicBlock const&); + Label next_target() const { return m_next_target; } + private: Label m_next_target; }; diff --git a/Userland/Libraries/LibJS/Bytecode/Pass/GenerateCFG.cpp b/Userland/Libraries/LibJS/Bytecode/Pass/GenerateCFG.cpp index 476cc937b7c144..d4be4b7148bf14 100644 --- a/Userland/Libraries/LibJS/Bytecode/Pass/GenerateCFG.cpp +++ b/Userland/Libraries/LibJS/Bytecode/Pass/GenerateCFG.cpp @@ -90,6 +90,11 @@ void GenerateCFG::perform(PassPipelineExecutable& executable) enter_label(&resume_target, current_block); continue; } + case FinishUnwind: { + auto const& next_target = static_cast(instruction).next_target(); + enter_label(&next_target, current_block); + continue; + } default: // Otherwise, pop the current block off, it doesn't jump anywhere. iterators.take_last();