if(emit->env->func != f)
CHECK_BO(emit_template_code(emit, f))
else {
- const Instr back = (Instr)vector_back(&emit->code->instr);
+//assert(vector_size(&emit->code->instr));
+ const Instr back = (Instr) vector_size(&emit->code->instr) ?
+ vector_back(&emit->code->instr) : emit_add_instr(emit, RegPushImm);
back->opcode = ePushStaticCode;
back->m_val = 0;
}
}
ANN static inline m_bool emit_member(const Emitter emit, const Value v, const uint emit_addr) {
+ if(is_class(emit->gwion, v->type)) {
+ const Instr instr= emit_add_instr(emit, RegSetImm);
+ instr->m_val = v->type;
+ return GW_OK;
+ }
+//assert(!is_class(emit->gwion, v->type));
const m_uint size = v->type->size;
const Instr instr = emit_kind(emit, size, emit_addr, dotmember);
instr->m_val = v->from->offset;
struct Op_Import opi = { .op=sym, .lhs=e->type,
.rhs=t, .data=(uintptr_t)&imp, .pos=e->pos };
CHECK_OB(op_check(env, &opi))
- e->nspc = env->curr;
+ assert(e->nspc);
return GW_OK;
}
ERR_O(exp_self(exp)->pos, _("template call of non-template function."))
if(t->e->d.func->def->base->tmpl->call) {
if(env->func == t->e->d.func) {
- CHECK_OO(check_exp(env, exp->args))
+ if(exp->args)
+ CHECK_OO(check_exp(env, exp->args))
exp->m_func = env->func;
return env->func->def->base->ret_type;
} else