diff options
| author | Kimplul <kimi.h.kuparinen@gmail.com> | 2024-08-09 22:26:09 +0300 |
|---|---|---|
| committer | Kimplul <kimi.h.kuparinen@gmail.com> | 2024-08-09 22:26:09 +0300 |
| commit | 0bee8234a52c9399544364e8d26b124cb487ce7c (patch) | |
| tree | e026b5482d740473c50055f4424eb87b362ddddc /src/lower.c | |
| parent | aa7ea13840e68abff8e9cf74376a6276f6a99033 (diff) | |
| download | ek-0bee8234a52c9399544364e8d26b124cb487ce7c.tar.gz ek-0bee8234a52c9399544364e8d26b124cb487ce7c.zip | |
fix trait expansion
+ Accidentally referenced an owned string, add strdup()
+ Didn't replace type IDs in ->t2
Diffstat (limited to 'src/lower.c')
| -rw-r--r-- | src/lower.c | 5 |
1 files changed, 4 insertions, 1 deletions
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; } |
