diff options
-rw-r--r-- | codegen.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -153,9 +153,11 @@ const void typedecl(Type *type) { println("typedef Type_%d * Type_%d ;", type->base->id, type->id); break; case TY_FUNC: { + type->id = 0; typedecl(type->return_ty); for (Type *p = type->params; p; p = p->next) typedecl(p); + if (!type->id) type->id = count(); printnoln("typedef Type_%d Type_%d ( ", type->return_ty->id, type->id); int i = 0; |