diff options
author | Hendiadyoin1 <leon.a@serenityos.org> | 2022-11-22 18:29:27 +0100 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2023-02-26 19:40:09 +0100 |
commit | 5181957da5310542388dad81528e0215482d302e (patch) | |
tree | 684d491cb127d8f4e8be7ed5c8c3e71c3fc6cd87 /Userland/Libraries/LibJS/Bytecode/Pass/GenerateCFG.cpp | |
parent | 09fa3a17c7efee4e792c768fe5eca381f1c51317 (diff) | |
download | serenity-5181957da5310542388dad81528e0215482d302e.zip |
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.
Diffstat (limited to 'Userland/Libraries/LibJS/Bytecode/Pass/GenerateCFG.cpp')
-rw-r--r-- | Userland/Libraries/LibJS/Bytecode/Pass/GenerateCFG.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/Userland/Libraries/LibJS/Bytecode/Pass/GenerateCFG.cpp b/Userland/Libraries/LibJS/Bytecode/Pass/GenerateCFG.cpp index 476cc937b7..a3ec92ca5b 100644 --- a/Userland/Libraries/LibJS/Bytecode/Pass/GenerateCFG.cpp +++ b/Userland/Libraries/LibJS/Bytecode/Pass/GenerateCFG.cpp @@ -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(); |