]> Nishi Git Mirror - gwion.git/commitdiff
:art: Fix unwind
authorfennecdjay <astor.jeremie@wanadoo.fr>
Thu, 25 Apr 2019 18:44:04 +0000 (20:44 +0200)
committerfennecdjay <astor.jeremie@wanadoo.fr>
Thu, 25 Apr 2019 18:44:04 +0000 (20:44 +0200)
src/vm/shreduler.c

index 37174a0335a6a2f425af68d5fc7305c3a7f9e7de..b961a5a919686d1bc2095020ff56a6b69c4cb266 100644 (file)
@@ -45,10 +45,9 @@ ANN static void unwind(const VM_Shred shred) {
     const m_bit exec = (m_bit)((Instr)vector_back(code->instr))->opcode;
     if(exec == eFuncReturn) {
       code = *(VM_Code*)(shred->mem - SZ_INT*3);
-//      if(!code)break;
       REM_REF(code, shred->info->vm->gwion);
       shred->mem -= *(m_uint*)(shred->mem - SZ_INT*4) + SZ_INT*4;
-      if(shred->mem == (((m_bit*)(shred) + sizeof(struct VM_Shred_) + SIZEOF_REG)))break;
+      if(shred->mem <= (((m_bit*)(shred) + sizeof(struct VM_Shred_) + SIZEOF_REG)))break;
     } else break;
   }
 }