commit f38f6cf7e05785b7ac6efc6d91866d26624a8436
parent 29af902f4338040189c256afca1949e21b9a0dcc
Author: Drew DeVault <sir@cmpwn.com>
Date: Mon, 2 Aug 2021 11:26:57 +0200
gen: correct ptr type in gen_expr_struct_at
Signed-off-by: Drew DeVault <sir@cmpwn.com>
Diffstat:
1 file changed, 1 insertion(+), 0 deletions(-)
diff --git a/src/gen.c b/src/gen.c
@@ -265,6 +265,7 @@ gen_expr_struct_at(struct gen_context *ctx,
struct qbe_value offs = constl(field->field->offset);
ftemp.type = field->value->result;
struct qbe_value ptr = mkqval(ctx, &ftemp);
+ ptr.type = ctx->arch.ptr;
pushi(ctx->current, &ptr, Q_ADD, &base, &offs, NULL);
struct gen_value init = gen_expr(ctx, field->value);