summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Sotoudeh <matthew@masot.net>2023-07-26 15:19:13 -0700
committerMatthew Sotoudeh <matthew@masot.net>2023-07-26 15:19:13 -0700
commit43a16ad9c3b4dd9466f1fa0ef69eee0562da99f1 (patch)
tree55bbf8f895853c888cc3633c18e7d6457dceafc1
parentcab3795047870ccc3a9d124e8b940e47d062a7c6 (diff)
fix in another place
-rw-r--r--codegen.c2
1 files changed, 2 insertions, 0 deletions
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;
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback