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

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
parent 09fa3a17c7
commit 5181957da5

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();