]> Nishi Git Mirror - gwion.git/commitdiff
:shirt: Add missing pragma
authorfennecdjay <astor.jeremie@wanadoo.fr>
Tue, 23 Jul 2019 05:45:49 +0000 (07:45 +0200)
committerfennecdjay <astor.jeremie@wanadoo.fr>
Tue, 23 Jul 2019 05:45:49 +0000 (07:45 +0200)
src/lib/shred.c
src/vm/vm.c

index 920cdfddfb78b92ef840ddb2b4d5a054c9124ecb..9aa6783e85fc85829d4ad2bbf5bf757f54e7a79f 100644 (file)
@@ -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) {
index 2e4bd7c18342413aa2f733283d4bb594abbae7a3..db8e46c405c91ec8d697c36581a8cbe04faab9cd 100644 (file)
@@ -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);