diff mbox series

[for-8.0] tcg/i386: Adjust assert in tcg_out_addi_ptr

Message ID 20230407190200.3259312-1-richard.henderson@linaro.org
State Superseded
Headers show
Series [for-8.0] tcg/i386: Adjust assert in tcg_out_addi_ptr | expand

Commit Message

Richard Henderson April 7, 2023, 7:02 p.m. UTC
We can arrive here on _WIN64 because Int128 is passed by reference.
Change the assert to check that the immediate is in range,
instead of attempting to check the host ABI.

Fixes: 6a6d772e30d ("tcg: Introduce tcg_out_addi_ptr")
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1581
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 tcg/i386/tcg-target.c.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Philippe Mathieu-Daudé April 11, 2023, 9:55 a.m. UTC | #1
On 7/4/23 21:02, Richard Henderson wrote:
> We can arrive here on _WIN64 because Int128 is passed by reference.
> Change the assert to check that the immediate is in range,
> instead of attempting to check the host ABI.
> 
> Fixes: 6a6d772e30d ("tcg: Introduce tcg_out_addi_ptr")
> Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1581
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>   tcg/i386/tcg-target.c.inc | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
diff mbox series

Patch

diff --git a/tcg/i386/tcg-target.c.inc b/tcg/i386/tcg-target.c.inc
index 4444eb9234..5a151fe64a 100644
--- a/tcg/i386/tcg-target.c.inc
+++ b/tcg/i386/tcg-target.c.inc
@@ -1082,7 +1082,7 @@  static void tcg_out_addi_ptr(TCGContext *s, TCGReg rd, TCGReg rs,
                              tcg_target_long imm)
 {
     /* This function is only used for passing structs by reference. */
-    tcg_debug_assert(TCG_TARGET_REG_BITS == 32);
+    tcg_debug_assert(imm == (int32_t)imm);
     tcg_out_modrm_offset(s, OPC_LEA, rd, rs, imm);
 }