#define emit_prim_nil (void*)dummy_func
ANN static inline void struct_interp(const Emitter emit, const Exp e) {
- if(GET_FLAG(e->info->type, struct)) {
+ if(GET_FLAG(e->info->type, struct) && !GET_FLAG(e->info->type, builtin)) {
exp_setvar(e, 1);
regpush(emit, e->info->type->size - SZ_INT);
}
const Instr instr = emit_add_instr(emit, Reg2RegAddr);
instr->m_val = -SZ_INT;
instr->m_val2 = -SZ_INT;
- }
+ } else if(!exp_call->m_func && GET_FLAG(e->info->type, struct))
+ regpop(emit, SZ_INT);
return GW_OK;
}
OP_CHECK(opck_object_scan) {
struct TemplateScan *ts = (struct TemplateScan*)data;
- if(ts->td->types)
+ if(ts->td->types && GET_FLAG(ts->t, template) && ts->t->e->def)
return scan_class(env, ts->t, ts->td);
if(!GET_FLAG(ts->t, template) || GET_FLAG(ts->t, unary))
return ts->t;