LibJS: VERIFY on unknown terminator opcodes in GenerateCFG

If we mess up in here it could break promises later optimization stages
assume, so rather than having wrong results, make it scream as load as
it can.
This commit is contained in:
Hendiadyoin1 2022-11-22 18:29:27 +01:00 committed by Linus Groh
commit 5181957da5
Notes: sideshowbarker 2024-07-16 23:59:28 +09:00

View file

@ -90,12 +90,15 @@ void GenerateCFG::perform(PassPipelineExecutable& executable)
enter_label(&resume_target, current_block);
continue;
}
default:
// Otherwise, pop the current block off, it doesn't jump anywhere.
case Throw:
case Return:
iterators.take_last();
entered_blocks.take_last();
continue;
}
default:
dbgln("Unhandled terminator instruction: `{}`", instruction.to_deprecated_string(executable.executable));
VERIFY_NOT_REACHED();
};
}
finished();