1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 13:18:13 +00:00

LibJS: Make EnterUnwindContext a terminator op

Otherwise a basic block could have multiple outgoing edges without
having much reason to do so.
This commit is contained in:
Ali Mohammad Pur 2021-06-13 20:39:40 +04:30 committed by Ali Mohammad Pur
parent e73b142a97
commit 4c7c7c38e2
3 changed files with 11 additions and 3 deletions

View file

@ -451,8 +451,11 @@ public:
class EnterUnwindContext final : public Instruction {
public:
EnterUnwindContext(Optional<Label> handler_target, Optional<Label> finalizer_target)
constexpr static bool IsTerminator = true;
EnterUnwindContext(Label entry_point, Optional<Label> handler_target, Optional<Label> finalizer_target)
: Instruction(Type::EnterUnwindContext)
, m_entry_point(move(entry_point))
, m_handler_target(move(handler_target))
, m_finalizer_target(move(finalizer_target))
{
@ -462,6 +465,7 @@ public:
String to_string(Bytecode::Executable const&) const;
private:
Label m_entry_point;
Optional<Label> m_handler_target;
Optional<Label> m_finalizer_target;
};