From 313cd06d3445b2223122c42d78471195b847d0d0 Mon Sep 17 00:00:00 2001 From: fennecdjay Date: Wed, 12 Jun 2019 13:55:39 +0200 Subject: [PATCH] :art: Improve parent checking --- src/emit/emit.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/emit/emit.c b/src/emit/emit.c index 7b29d53c..5b91666d 100644 --- a/src/emit/emit.c +++ b/src/emit/emit.c @@ -1773,6 +1773,9 @@ ANN inline void emit_class_finish(const Emitter emit, const Nspc nspc) { ANN static m_bool emit_parent(const Emitter emit, const Class_Def cdef) { const Type parent = cdef->base.type->e->parent; + const Type base = parent->e->d.base_type; + if(base && !GET_FLAG(base, emit)) + CHECK_BB(scanx_parent(base, emit_parent_inner, emit)) return !GET_FLAG(parent, emit) ? GW_OK : scanx_parent(parent, emit_parent_inner, emit); } @@ -1785,10 +1788,10 @@ ANN static m_bool emit_class_def(const Emitter emit, const Class_Def cdef) { if(tmpl_base(cdef->base.tmpl)) return GW_OK; const Type type = cdef->base.type; - SET_FLAG(type, emit); const Nspc nspc = type->nspc; if(cdef->base.ext && cdef->base.ext->types) CHECK_BB(scanx_ext(emit->env, cdef, emit_parent, emit)) + SET_FLAG(type, emit); nspc_allocdata(emit->gwion->mp, nspc); emit_class_code(emit, type->name); if(cdef->base.ext && cdef->base.ext->array) -- 2.43.0