From 1ac6432d8832d54ca2d47f6c9bffa4740eb2bd8a Mon Sep 17 00:00:00 2001 From: fennecdjay Date: Tue, 23 Jul 2019 07:45:49 +0200 Subject: [PATCH] :shirt: Add missing pragma --- src/lib/shred.c | 5 ++++- src/vm/vm.c | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/lib/shred.c b/src/lib/shred.c index 920cdfdd..9aa6783e 100644 --- a/src/lib/shred.c +++ b/src/lib/shred.c @@ -61,7 +61,10 @@ static MFUN(vm_shred_is_done) { static MFUN(shred_yield) { const VM_Shred s = ME(o); const Shreduler sh = s->tick->shreduler; - shredule(sh, s, GWION_EPSILON); + if(vector_size(shred->code->instr) - shred->pc > 1) + shredule(sh, s, GWION_EPSILON); + else + vm_shred_exit(shred); } static SFUN(vm_shred_from_id) { diff --git a/src/vm/vm.c b/src/vm/vm.c index 2e4bd7c1..db8e46c4 100644 --- a/src/vm/vm.c +++ b/src/vm/vm.c @@ -641,10 +641,12 @@ sporkini: DISPATCH() sporkfunc: // LOOP_OPTIM +PRAGMA_PUSH() for(m_uint i = 0; i < VAL; i+= SZ_INT) *(m_uint*)(a.child->reg + i) = *(m_uint*)(reg + i + (m_int)VAL2); a.child->reg += VAL; DISPATCH() +PRAGMA_POP() sporkmemberfptr: for(m_uint i = 0; i < VAL-SZ_INT; i+= SZ_INT) *(m_uint*)(a.child->reg + i) = *(m_uint*)(reg + i + (m_int)VAL2+SZ_INT); -- 2.43.0