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

LibJS: Fix that the interpreter did not clear the unwind status

This meant that if some program threw an uncaught exception VM still
had unwind_until set. This caused any further programs to not execute
correctly.
This will be fixed more thoroughly once we use Completions in the AST.

Fixes #10323
This commit is contained in:
davidot 2021-10-03 13:27:26 +02:00 committed by Andreas Kling
parent f4f1397735
commit ac808a261f

View file

@ -63,6 +63,10 @@ void Interpreter::run(GlobalObject& global_object, const Program& program)
auto value = program.execute(*this, global_object);
vm.set_last_value(Badge<Interpreter> {}, value.value_or(js_undefined()));
// FIXME: We unconditionally stop the unwind here this should be done using completions leaving
// the VM in a cleaner state after executing. For example it does still store the exception.
vm.stop_unwind();
vm.pop_execution_context();
// At this point we may have already run any queued promise jobs via on_call_stack_emptied,