1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 05:27:43 +00:00

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
parent 1c8adac442
commit 5506951ffb

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;