]> 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:36:58 +0000 (12:36 +0200)
src/import/cdef.c
src/main.c
src/vm/vm.c
util

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;
 }
 
index f21c092153826a6087423c704cff70c7c0bf6e0a..130ae98cca6564ab7dc878bd292d01acb798b35c 100644 (file)
@@ -42,5 +42,8 @@ int main(int argc, char** argv) {
   if(ini > 0)
     gwion_run(&gwion);
   gwion_end(&gwion);
-  THREAD_RETURN(EXIT_SUCCESS);
+#ifndef BUILD_ON_WINDOWS
+  pthread_exit(NULL);
+#endif
+  return EXIT_SUCCESS;
 }
index b967991a9e469699818cf4ec972da9dc40eef18d..cab5a91c6383b02cc27af543878d5d3fe4fc9678 100644 (file)
@@ -275,7 +275,8 @@ _Pragma(STRINGIFY(COMPILER diagnostic ignored UNINITIALIZED)
 
 #define VM_OUT shred->code = code; shred->reg = reg; shred->mem = mem; shred->pc = PC;
 
-__attribute__ ((hot, optimize("-O2")))
+__attribute__ ((hot))
+CC_OPTIM(-O2)
 ANN void vm_run(const VM* vm) { // lgtm [cpp/use-of-goto]
   static const void* dispatch[] = {
     &&regsetimm,
diff --git a/util b/util
index 6a4d0ad780438022192c2b8e1c129c85e6b897e5..01599165dac235c3e2e048c3525054a5d8dd556e 160000 (submodule)
--- a/util
+++ b/util
@@ -1 +1 @@
-Subproject commit 6a4d0ad780438022192c2b8e1c129c85e6b897e5
+Subproject commit 01599165dac235c3e2e048c3525054a5d8dd556e