if((f_instr)back->opcode == DotFunc)
back->m_val = f->vt_index;
}
+ if(GET_FLAG(f, member) && isa(actual_type(f->value_ref->type), t_fptr) > 0) {
+ const Instr back = (Instr)vector_back(&emit->code->instr);
+ m_bit exec = back->opcode;
+ m_uint val = back->m_val;
+ m_uint val2 = back->m_val2;
+ back->opcode = RegDup;
+ const Instr instr = emit_add_instr(emit, exec);
+ instr->m_val = val;
+ instr->m_val2 = val2;
+ }
const Instr offset = emit_add_instr(emit, RegSetImm);
offset->m_val = emit_code_offset(emit);
const Instr instr = emit_call(emit, f);
static INSTR(FuncAssign) { GWDEBUG_EXE
POP_REG(shred, SZ_INT)
**(Func**)REG(0) = *(Func*)REG(-SZ_INT);
+ if(GET_FLAG(*(Func*)REG(-SZ_INT), member))
+ POP_REG(shred, SZ_INT)
}
static OP_CHECK(opck_func_call) {
CHECK_BB(scan2_args(env, &d))
const Func_Def def = new_func_def(ptr->td, ptr->xid, ptr->args, NULL, ptr->td->flag);
def->ret_type = ptr->ret_type;
+ def->stack_depth = d.stack_depth;
ptr->func = new_func(s_name(ptr->xid), def);
ptr->value->d.func_ref = ptr->func;
ptr->func->value_ref = ptr->value;
reg += SZ_INT;
DISPATCH();
funcreturn:
- pc = *(m_uint*)(mem-SZ_INT);
- code = *(VM_Code*)(mem-SZ_INT*2);
- mem -= (*(m_uint*)(mem-SZ_INT*3) + SZ_INT*3);
+ pc = *(m_uint*)(mem-SZ_INT*2);
+ code = *(VM_Code*)(mem-SZ_INT*3);
+ mem -= (*(m_uint*)(mem-SZ_INT*4) + SZ_INT*4);
ip = code->instr->ptr + OFFSET;
DISPATCH();
_goto:
code = *(VM_Code*)reg;
ip = code->instr->ptr + OFFSET;
m_uint stack_depth = code->stack_depth;
+ *(m_uint*) mem = stack_depth; mem += SZ_INT;
if(stack_depth) {
register const m_uint f = GET_FLAG(code, member) ? SZ_INT : 0;
if(f) {