diff options
author | Matthew Sotoudeh <matthew@masot.net> | 2023-07-26 15:19:13 -0700 |
---|---|---|
committer | Matthew Sotoudeh <matthew@masot.net> | 2023-07-26 15:19:13 -0700 |
commit | 43a16ad9c3b4dd9466f1fa0ef69eee0562da99f1 (patch) | |
tree | 55bbf8f895853c888cc3633c18e7d6457dceafc1 /codegen.c | |
parent | cab3795047870ccc3a9d124e8b940e47d062a7c6 (diff) |
fix in another place
Diffstat (limited to 'codegen.c')
-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; |