From: Jérémie Astor Date: Fri, 6 Dec 2019 20:01:26 +0000 (+0100) Subject: :art: Improve vm X-Git-Tag: nightly~2068^2~8 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=5158285a462f216e99f95afd0269a3ddeff45943;p=gwion.git :art: Improve vm --- 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