From: fennecdjay Date: Tue, 9 May 2023 08:40:56 +0000 (+0200) Subject: :: enum X-Git-Tag: nightly~164 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=32bfa8cdd0751f739446d25e31846061d983eb5a;p=gwion.git :: enum --- diff --git a/src/emit/emit.c b/src/emit/emit.c index cda18b6c..46a16e2b 100644 --- a/src/emit/emit.c +++ b/src/emit/emit.c @@ -2371,7 +2371,8 @@ ANN static m_bool emit_enum_def(const Emitter emit NUSED, const Enum_Def edef) { LOOP_OPTIM for (m_uint i = 0; i < vector_size(&edef->values); ++i) { const Value v = (Value)vector_at(&edef->values, i); - *(m_uint *)(v->from->owner->class_data + v->from->offset) = i; + set_vflag(v, vflag_builtin); + v->d.num = i; } set_tflag(edef->type, tflag_emit); return GW_OK; diff --git a/src/parse/check.c b/src/parse/check.c index b40704bc..83460f61 100644 --- a/src/parse/check.c +++ b/src/parse/check.c @@ -1336,7 +1336,6 @@ ANN m_bool check_enum_def(const Env env, const Enum_Def edef) { decl_static(env, nspc_lookup_value0(env->curr, xid)); } env_pop(env, scope); - nspc_allocdata(env->gwion->mp, edef->type->nspc); return GW_OK; }