Skip to content

Commit

Permalink
LibJS: Handle FinishUnwind in GenerateCFG
Browse files Browse the repository at this point in the history
  • Loading branch information
Hendiadyoin1 authored and alimpfard committed Dec 3, 2022
1 parent 6998b72 commit a00c421
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Userland/Libraries/LibJS/Bytecode/Op.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
Expand Down
5 changes: 5 additions & 0 deletions Userland/Libraries/LibJS/Bytecode/Pass/GenerateCFG.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,11 @@ void GenerateCFG::perform(PassPipelineExecutable& executable)
enter_label(&resume_target, current_block);
continue;
}
case FinishUnwind: {
auto const& next_target = static_cast<Op::FinishUnwind const&>(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();
Expand Down

0 comments on commit a00c421

Please sign in to comment.