From: Jérémie Astor Date: Mon, 14 Sep 2020 10:21:13 +0000 (+0200) Subject: :art: Rewrite class_parent X-Git-Tag: nightly~1315^2 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=8ff2e6dd925725455cf80dbc4f038f79fbf74459;p=gwion.git :art: Rewrite class_parent --- diff --git a/src/import/cdef.c b/src/import/cdef.c index 32b62f49..4419336f 100644 --- a/src/import/cdef.c +++ b/src/import/cdef.c @@ -27,11 +27,12 @@ ANN static m_bool mk_xtor(MemPool p, const Type type, const m_uint d, const ae_f } ANN2(1,2) static inline m_bool class_parent(const Env env, Type t) { - while(t && !GET_FLAG(t, valid)) { + do { + if(GET_FLAG(t, valid)) + break; if(t->e->def) CHECK_BB(traverse_class_def(env, t->e->def)) - t = t->e->parent; - } + } while((t = t->e->parent)); return GW_OK; }