From 8ff2e6dd925725455cf80dbc4f038f79fbf74459 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Astor?= Date: Mon, 14 Sep 2020 12:21:13 +0200 Subject: [PATCH] :art: Rewrite class_parent --- src/import/cdef.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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; } -- 2.43.0