* [PATCH] tcg: Fix info_in_idx increment in layout_arg_by_ref
@ 2023-07-07 10:29 Richard Henderson
2023-07-07 13:29 ` Philippe Mathieu-Daudé
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Richard Henderson @ 2023-07-07 10:29 UTC (permalink / raw)
To: qemu-devel; +Cc: peter.maydell, qemu-stable
Off by one error, failing to take into account that layout_arg_1
already incremeneted 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: 313bdea84d2 ("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>
---
tcg/tcg.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tcg/tcg.c b/tcg/tcg.c
index a0628fe424..652e8ea6b9 100644
--- a/tcg/tcg.c
+++ b/tcg/tcg.c
@@ -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;
}
--
2.34.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] tcg: Fix info_in_idx increment in layout_arg_by_ref
2023-07-07 10:29 [PATCH] tcg: Fix info_in_idx increment in layout_arg_by_ref Richard Henderson
@ 2023-07-07 13:29 ` Philippe Mathieu-Daudé
2023-07-07 13:30 ` Philippe Mathieu-Daudé
2023-07-13 12:37 ` Peter Maydell
2 siblings, 0 replies; 4+ messages in thread
From: Philippe Mathieu-Daudé @ 2023-07-07 13:29 UTC (permalink / raw)
To: Richard Henderson, qemu-devel; +Cc: peter.maydell, qemu-stable
On 7/7/23 12:29, Richard Henderson wrote:
> Off by one error, failing to take into account that layout_arg_1
> already incremeneted 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: 313bdea84d2 ("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>
> ---
> tcg/tcg.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] tcg: Fix info_in_idx increment in layout_arg_by_ref
2023-07-07 10:29 [PATCH] tcg: Fix info_in_idx increment in layout_arg_by_ref Richard Henderson
2023-07-07 13:29 ` Philippe Mathieu-Daudé
@ 2023-07-07 13:30 ` Philippe Mathieu-Daudé
2023-07-13 12:37 ` Peter Maydell
2 siblings, 0 replies; 4+ messages in thread
From: Philippe Mathieu-Daudé @ 2023-07-07 13:30 UTC (permalink / raw)
To: Richard Henderson, qemu-devel; +Cc: peter.maydell, qemu-stable
On 7/7/23 12:29, Richard Henderson wrote:
> Off by one error, failing to take into account that layout_arg_1
> already incremeneted info_in_idx for the first piece. We only
"incremented"
> need care for the n-1 TCG_CALL_ARG_BY_REF_N pieces here.
>
> Cc: qemu-stable@nongnu.org
> Fixes: 313bdea84d2 ("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>
> ---
> tcg/tcg.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] tcg: Fix info_in_idx increment in layout_arg_by_ref
2023-07-07 10:29 [PATCH] tcg: Fix info_in_idx increment in layout_arg_by_ref Richard Henderson
2023-07-07 13:29 ` Philippe Mathieu-Daudé
2023-07-07 13:30 ` Philippe Mathieu-Daudé
@ 2023-07-13 12:37 ` Peter Maydell
2 siblings, 0 replies; 4+ messages in thread
From: Peter Maydell @ 2023-07-13 12:37 UTC (permalink / raw)
To: Richard Henderson; +Cc: qemu-devel, qemu-stable
On Fri, 7 Jul 2023 at 11:29, Richard Henderson
<richard.henderson@linaro.org> wrote:
>
> Off by one error, failing to take into account that layout_arg_1
> already incremeneted 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: 313bdea84d2 ("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>
> ---
Tested-by: Peter Maydell <peter.maydell@linaro.org>
-- PMM
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-07-13 12:38 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-07 10:29 [PATCH] tcg: Fix info_in_idx increment in layout_arg_by_ref Richard Henderson
2023-07-07 13:29 ` Philippe Mathieu-Daudé
2023-07-07 13:30 ` Philippe Mathieu-Daudé
2023-07-13 12:37 ` Peter Maydell
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).