]> Nishi Git Mirror - gwion.git/commitdiff
:art: Improve fptr decl checking
authorJérémie Astor <astor.jeremie@wanadoo.fr>
Sun, 15 Dec 2019 11:53:18 +0000 (12:53 +0100)
committerJérémie Astor <astor.jeremie@wanadoo.fr>
Sun, 15 Dec 2019 11:53:18 +0000 (12:53 +0100)
src/parse/check.c

index 3e5b2aa29493d900b145cc172787c9bcd5953dbf..6a2e44ffe449d08263d7e27d1919ab28cd399622 100644 (file)
@@ -68,7 +68,12 @@ describe_check_decl(static, class_data_size)
 
 ANN static m_bool check_fptr_decl(const Env env, const Var_Decl var) {
   const Value v    = var->value;
-  const Func  func = v->type->e->d.func;
+  Type t = v->type;
+  while(GET_FLAG(t, typedef))
+    t = t->e->parent;
+  if(!t->e->d.func)
+    return GW_ERROR;
+  const Func  func = t->e->d.func;
   const Type type = func->value_ref->from->owner_class;
   if(!env->class_def) {
     if(!type || GET_FLAG(func, global))