: emit_regpushbase(emit, size, exp_getvar(prim_exp(data)));
instr->m_val = v->from->offset;
if (GET_FLAG(v, late) && !exp_getvar(prim_exp(data)) &&
- isa(v->type, emit->gwion->type[et_object]) > 0) {
+ (isa(v->type, emit->gwion->type[et_object]) > 0 || is_fptr(emit->gwion, v->type))) {
const Instr instr = emit_add_instr(emit, GWOP_EXCEPT);
instr->m_val = -SZ_INT;
}
if (vector_size(&emit->code->instr) && vflag(f->value_ref, vflag_member) &&
is_fptr(emit->gwion, f->value_ref->type)) {
const Instr back = (Instr)vector_back(&emit->code->instr);
- const Instr base =
- back->opcode != eGWOP_EXCEPT
+ const bool is_except = back->opcode == eGWOP_EXCEPT;
+ const Instr base = !is_except
? back
: (Instr)vector_at(&emit->code->instr,
vector_size(&emit->code->instr) - 2);
+ if(is_except)
+ vector_pop(&emit->code->instr);
const m_bit exec = base->opcode;
const m_uint val = base->m_val;
const m_uint val2 = base->m_val2;
const Instr instr = emit_add_instr(emit, (f_instr)(m_uint)exec);
instr->m_val = val;
instr->m_val2 = val2;
+ if(is_except) {
+ vector_add(&emit->code->instr, (m_uint)back);
+ back->m_val = -SZ_INT;
+ }
} else if (f != emit->env->func && !f->code &&
!is_fptr(emit->gwion, f->value_ref->type)) {
// not yet emitted static func
vmcode_addref(*(VM_Code *)(shred->reg - offset));
uu->shred->info->vm = shred->info->vm;
code_prepare(vmcode_callback(shred->info->mp, uu->shred->code));
- shreduler_ini(uu->shred->info->vm->shreduler, uu->shred);
+ shreduler_ini(uu->shred->tick->shreduler, uu->shred);
uu->prep = instr->m_val ? member_prep : global_prep;
*(M_Object *)(shred->reg - SZ_INT) = o;
}
ANN static inline void shreduler_child(const Vector v) {
for (m_uint i = vector_size(v) + 1; --i;) {
const VM_Shred child = (VM_Shred)vector_at(v, i - 1);
- shreduler_remove(child->info->vm->shreduler, child, true);
+ shreduler_remove(child->tick->shreduler, child, true);
}
}