harec

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

commit 61dcd8b5073dbacdfcb6ea906eb2e99c6c3a6b92
parent 6f93e47f3a09ac8e9b06f441c831c7a4b9bdf62a
Author: Drew DeVault <sir@cmpwn.com>
Date:   Fri, 13 Aug 2021 09:11:06 +0200

gen: fix memmove address calculation

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

Diffstat:
Msrc/gen.c | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/gen.c b/src/gen.c @@ -1618,7 +1618,7 @@ gen_expr_insert(struct gen_context *ctx, const struct expression *expr) struct qbe_value src = mkqtmp(ctx, ctx->arch.ptr, ".%d"); pushi(ctx->current, &src, Q_MUL, &qindex, &membsz, NULL); - pushi(ctx->current, &src, Q_ADD, &base, &membsz, NULL); + pushi(ctx->current, &src, Q_ADD, &base, &src, NULL); struct qbe_value nbyte = mkqtmp(ctx, ctx->arch.sz, ".%d"); struct qbe_value dest = mkqtmp(ctx, ctx->arch.ptr, ".%d"); pushi(ctx->current, &nbyte, Q_MUL, &nadd, &membsz, NULL);