From 43a16ad9c3b4dd9466f1fa0ef69eee0562da99f1 Mon Sep 17 00:00:00 2001 From: Matthew Sotoudeh Date: Wed, 26 Jul 2023 15:19:13 -0700 Subject: fix in another place --- codegen.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'codegen.c') diff --git a/codegen.c b/codegen.c index 8b99e64..5111c76 100644 --- a/codegen.c +++ b/codegen.c @@ -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; -- cgit v1.2.3