const M_Object o = new_object(emit->gwion->mp, NULL, udef->value->type);
udef->value->d.ptr = (m_uint*)o;
SET_FLAG(udef->value, builtin);
- SET_FLAG(udef->value, global);
+ UNSET_FLAG(udef->value, union);
}
scope = emit_push_type(emit, udef->value->type);
} else if(udef->type_xid) {
SET_FLAG(list->self->value, union);
} while((l = l->next));
SET_FLAG(udef->l->self->d.exp_decl.list->self->value, enum);
+ SET_FLAG(udef->l->self->d.exp_decl.list->self->value, dtor);
}
if(udef->xid)
regpop(emit, SZ_INT);
!(GET_FLAG(a, enum) && GET_FLAG(a, builtin) && a->from->owner_class)
&& isa(t, gwion->type[et_object]) < 0)
_mp_free(gwion->mp, t->size, a->d.ptr);
+ if(GET_FLAG(a, enum) && GET_FLAG(a, dtor))
+ xfree(a->d.ptr);
if(is_class(gwion, t))
REM_REF(t, gwion)
mp_free(gwion->mp, ValueFrom, a->from);
Decl_List l = udef->l;
do {
CHECK_OB(check_exp(env, l->self))
- if(isa(l->self->type, env->gwion->type[et_object]) > 0) {
- Var_Decl_List list = l->self->d.exp_decl.list;
- do SET_FLAG(list->self->value, pure);
- while((list = list->next));
- }
+ Var_Decl_List list = l->self->d.exp_decl.list;
+ do SET_FLAG(list->self->value, pure);
+ while((list = list->next));
if(l->self->type->size > udef->s)
udef->s = l->self->type->size;
} while((l = l->next));
--- /dev/null
+union global {
+ int int_from_global_union;
+ float float_from_global_union;
+} global_union;
+
+<<< "HERE", global_union >>>;
+<<< 123.456 => global_union.float_from_global_union >>>;
+<<< global_union.float_from_global_union >>>;