From abbea761bb3274b1e08ae8ccbf572f20d7a39911 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Astor?= Date: Tue, 3 Dec 2019 17:30:14 +0100 Subject: [PATCH] :art: Make vm_running recursive --- src/vm/vm.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/vm/vm.c b/src/vm/vm.c index c3456ae8..f251ca8a 100644 --- a/src/vm/vm.c +++ b/src/vm/vm.c @@ -79,9 +79,11 @@ ANN void vm_unlock(VM *vm) { } ANN m_bool vm_running(VM *vm) { - do if(!vm->shreduler->bbq->is_running) return 0; - while((vm = vm->parent)); - return 1; + if(!vm->shreduler->bbq->is_running) + return 0; + if(!vm->parent) + return 1; + return vm->shreduler->bbq->is_running = vm_running(vm->parent); } ANN static void vm_fork(VM* src, const VM_Shred shred) { -- 2.43.0