harec

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit ff4b568a8f0d8bf8d70695af34240acd69be1c8a
parent 439ef102ec73b1f8415ebc1e55e5dffc903081c1
Author: Drew DeVault <sir@cmpwn.com>
Date:   Sat, 14 Aug 2021 11:46:20 +0200

gen: fix type for alloc object

Signed-off-by: Drew DeVault <sir@cmpwn.com>

Diffstat:
Msrc/gen.c | 7++++++-
1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/gen.c b/src/gen.c @@ -485,7 +485,12 @@ gen_expr_alloc_with(struct gen_context *ctx, push(&ctx->current->body, &lvalid); } - gen_expr_at(ctx, expr->alloc.expr, result); + struct gen_value object = { + .kind = GV_TEMP, + .type = type_dereference(expr->result), + .name = result.name, + }; + gen_expr_at(ctx, expr->alloc.expr, object); if (out) { gen_store(ctx, *out, result); }