}
ANN static void interp_size(const Emitter emit, const Type t) {
- const m_uint sz = isa(t, emit->gwion->type[et_compound]) < 0 ?
+ const m_uint sz = (isa(t, emit->gwion->type[et_object]) < 0 ||
+ (!GET_FLAG(t, builtin) && isa(t, emit->gwion->type[et_compound]) > 0))?
t->size : SZ_INT;
const Instr instr = regseti(emit, sz);
instr->m_val2 = SZ_INT;
}
ANN static inline int struct_ctor(const Value v) {
- return GET_FLAG(v->type, struct);
+ return GET_FLAG(v->type, struct) && !GET_FLAG(v->type, builtin);
}
ANN static void decl_expand(const Emitter emit, const Type t) {
ANN Type gwi_struct_ini(const Gwi gwi, const m_str name) {
CHECK_OO(str2sym(gwi, name))
- const Type t = new_type(gwi->gwion->mp, ++gwi->gwion->env->scope->type_xid, name, NULL);
+ const Type t = new_type(gwi->gwion->mp, ++gwi->gwion->env->scope->type_xid, name, gwi->gwion->type[et_compound]);
t->e->tuple = new_tupleform(gwi->gwion->mp, NULL);
gwi_type_flag(t);
SET_FLAG(t, struct);
ANN static Type check_prim_interp(const Env env, const Exp* exp) {
CHECK_OO(check_exp(env, *exp))
Exp e = *exp;
- do if(GET_FLAG(e->info->type, struct))
+ do if(GET_FLAG(e->info->type, struct) && !GET_FLAG(e->info->type, builtin))
exp_setvar(e, 1);
while((e = e->next));
return env->gwion->type[et_string];
DISPATCH()
allocother:
// LOOP_OPTIM
- for(m_uint i = 0; i <= VAL; i += SZ_INT)
+ for(m_uint i = 0; i <= VAL2; i += SZ_INT)
*(m_uint*)(reg+i) = (*(m_uint*)(mem+VAL+i) = 0);
reg += VAL2;
DISPATCH()