From 5158285a462f216e99f95afd0269a3ddeff45943 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Astor?= Date: Fri, 6 Dec 2019 21:01:26 +0100 Subject: [PATCH] :art: Improve vm --- src/vm/vm.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/vm/vm.c b/src/vm/vm.c index 19a80654..e61cb85a 100644 --- a/src/vm/vm.c +++ b/src/vm/vm.c @@ -339,6 +339,7 @@ ANN void vm_run(const VM* vm) { // lgtm [cpp/use-of-goto] const Shreduler s = vm->shreduler; register VM_Shred shred; register m_bit next; + while((shred = shreduler_get(s))) { register VM_Code code = shred->code; register m_bit* bytecode = code->bytecode; @@ -659,8 +660,10 @@ funcmemberend: } PC_DISPATCH(shred->pc) sporkini: - if(!(a.child = (VAL2 ? init_spork_shred : init_fork_shred)(shred, (VM_Code)VAL))) - goto eoc; + if(!(a.child = (VAL2 ? init_spork_shred : init_fork_shred)(shred, (VM_Code)VAL))) { + exception(shred, "[SporkAbortedException]"); + continue; + } DISPATCH() sporkfunc: // LOOP_OPTIM -- 2.43.0