From 32bfa8cdd0751f739446d25e31846061d983eb5a Mon Sep 17 00:00:00 2001 From: fennecdjay Date: Tue, 9 May 2023 10:40:56 +0200 Subject: [PATCH] :: enum --- src/emit/emit.c | 3 ++- src/parse/check.c | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) 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; } -- 2.43.0