harec

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

commit 9d1d4f3a8d66ce1d0df74e528b770586b712074f
parent f38f6cf7e05785b7ac6efc6d91866d26624a8436
Author: Drew DeVault <sir@cmpwn.com>
Date:   Mon,  2 Aug 2021 11:34:30 +0200

gen: use gen_expr_at for struct fields

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

Diffstat:
Msrc/gen.c | 6+-----
1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/src/gen.c b/src/gen.c @@ -260,16 +260,12 @@ gen_expr_struct_at(struct gen_context *ctx, continue; } - // TODO: We likely want to special-case this in the same way as - // the comment for gen_expr_binding describes. 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); - gen_store(ctx, ftemp, init); + gen_expr_at(ctx, field->value, ftemp); } }