From 0bee8234a52c9399544364e8d26b124cb487ce7c Mon Sep 17 00:00:00 2001 From: Kimplul Date: Fri, 9 Aug 2024 22:26:09 +0300 Subject: fix trait expansion + Accidentally referenced an owned string, add strdup() + Didn't replace type IDs in ->t2 --- src/lower.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/lower.c') diff --git a/src/lower.c b/src/lower.c index 2209b8e..b9f9665 100644 --- a/src/lower.c +++ b/src/lower.c @@ -269,7 +269,10 @@ static int lower_simple_param(struct lower_state *s, struct ast *p) UNUSED(s); char *t = is_small_type(p->t) ? "i9" : "i27"; printf("%s ", t); - output_ast_id(p); + + if (var_id(p)) output_ast_id(p); + else printf("tmp%zd", s->uniq++); + printf(", "); return 0; } -- cgit v1.3