Skip to content

Commit

Permalink
tcg: Fix info_in_idx increment in layout_arg_by_ref
Browse files Browse the repository at this point in the history
Off by one error, failing to take into account that layout_arg_1
already incremented info_in_idx for the first piece.  We only
need care for the n-1 TCG_CALL_ARG_BY_REF_N pieces here.

Cc: qemu-stable@nongnu.org
Fixes: 313bdea ("tcg: Add TCG_CALL_{RET,ARG}_BY_REF")
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1751
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20230707102955.5607-1-richard.henderson@linaro.org>
  • Loading branch information
rth7680 committed Jul 11, 2023
1 parent 19aa2ec commit 66fa3be
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tcg/tcg.c
Original file line number Diff line number Diff line change
Expand Up @@ -1083,7 +1083,7 @@ static void layout_arg_by_ref(TCGCumulativeArgs *cum, TCGHelperInfo *info)
.ref_slot = cum->ref_slot + i,
};
}
cum->info_in_idx += n;
cum->info_in_idx += n - 1; /* i=0 accounted for in layout_arg_1 */
cum->ref_slot += n;
}

Expand Down

0 comments on commit 66fa3be

Please sign in to comment.