const Instr instr = emit_add_instr(emit, Reg2RegAddr);
instr->m_val = -SZ_INT;
} else {
- if(isa(t, emit->gwion->type[et_object]) > 0) {
-//emit_object_addref(emit, -SZ_INT, 0);
- emit_local_exp(emit, e);
-// emit_localx(emit, t);
- }
if (!is_func(emit->gwion, exp_call->func->type) &&
tflag(e->type, tflag_struct))
regpop(emit, SZ_INT);
}
+ if(isa(e->type, emit->gwion->type[et_object]) > 0)
+ emit_local_exp(emit, e);
return GW_OK;
}
return optimize_tail_call(emit, &stmt->val->d.exp_call);
}
CHECK_BB(emit_exp_pop_next(emit, stmt->val));
-
- if(isa(stmt->val->type, emit->gwion->type[et_object]) > 0 &&
- (!stmt->val->data && stmt->val->acquire))
- emit_object_addref(emit, -SZ_INT, exp_getvar(stmt->val));
}
vector_add(&emit->code->stack_return, (vtype)emit_add_instr(emit, Goto));
return GW_OK;
if (GET_FLAG(cdef, global))
env->curr = (Nspc)vector_pop(&env->scope->nspc_stack);
if (cpy && cdef->base.type) {
- c->base.type = cdef->base.type;
+ c->base.type = cdef->base.type;
c->base.type->info->cdef = cdef;
set_tflag(c->base.type, tflag_cdef);
}
+// if (GET_FLAG(cdef, global))
+// type_addref(c->base.type);
return ret;
}
if(!env->class_def)
ERR_B(fdef->base->pos, _("{G+}new{0} operator must be set inside {C+}class{0}"));
if(!fdef->base->ret_type)
- fdef->base->ret_type = env->class_def;
+// fdef->base->ret_type = env->class_def;
+ fdef->base->ret_type = env->gwion->type[et_auto];
}
if (GET_FLAG(fdef->base, global) && !env->class_def) env->context->global = 1;
const Func_Def f = !is_cpy(fdef) ? fdef : scan2_cpy_fdef(env, fdef);