]> Nishi Git Mirror - gwion.git/commitdiff
:art: Rewrite class_parent
authorJérémie Astor <astor.jeremie@wanadoo.fr>
Mon, 14 Sep 2020 10:21:13 +0000 (12:21 +0200)
committerJérémie Astor <astor.jeremie@wanadoo.fr>
Mon, 14 Sep 2020 10:21:13 +0000 (12:21 +0200)
src/import/cdef.c

index 32b62f4967f89c0bd206dc37f79895e5ed6aff20..4419336f8fe32729126f74ea73e43c59ed2a5bb8 100644 (file)
@@ -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;
 }