const Func f = !sp->code ? sp->exp->d.exp_call.m_func : NULL;
const Instr instr = emit_add_instr(emit, ForkIni);
instr->m_val = (m_uint)sp->vm_code;
- instr->m_val2 = f ? sp->type->size : 0;
+ instr->m_val2 = sp->type->size;
return instr;
}
const Type fork = env->gwion->type[et_fork];
UNSET_FLAG(fork, final);
const Type typed = str2type(env->gwion, "TypedFork", exp_self(unary)->pos);
+ // ensure room for retval
+ if(typed->nspc->info->offset == fork->nspc->info->offset)
+ typed->nspc->info->offset += t->size;
UNSET_FLAG(typed, final);
const Type ret = str2type(env->gwion, c, exp_self(unary)->pos);
SET_FLAG(typed, final);
vm_run(vm);
++vm->bbq->pos;
}
- memcpy(me->data + vm->gwion->type[et_fork]->nspc->info->offset, *(m_bit**)ME(me)->reg, FORK_RETSIZE(me));
gwion_end_child(ME(me), vm->gwion);
MUTEX_LOCK(vm->parent->shreduler->mutex);
+ if(!*(m_int*)(me->data + o_shred_cancel) && me->type_ref != vm->gwion->type[et_fork])
+ memcpy(me->data + vm->gwion->type[et_fork]->nspc->info->offset, ME(me)->reg, FORK_RETSIZE(me));
*(m_int*)(me->data + o_fork_done) = 1;
if(!*(m_int*)(me->data + o_shred_cancel))
broadcast(*(M_Object*)(me->data + o_fork_ev));
+++ /dev/null
-#! [contains] is abstract, declare as ref
-var Shred shred;