LibJS: Don't try to merge unterminated BasicBlocks

This was causing a Segfault, trying to access the non-present terminator
This commit is contained in:
Hendiadyoin1 2023-02-21 21:38:30 +01:00 committed by Linus Groh
commit 5506951ffb
Notes: sideshowbarker 2024-07-17 11:33:34 +09:00

View file

@ -30,6 +30,9 @@ void MergeBlocks::perform(PassPipelineExecutable& executable)
if (executable.exported_blocks->contains(*entry.value.begin()))
continue;
if (!entry.key->is_terminated())
continue;
if (entry.key->terminator()->type() != Instruction::Type::Jump)
continue;