From: Joseph Burt Date: Sun, 21 Jan 2024 21:14:39 +0000 (+0000) Subject: tcg/arm: Fix SIGILL in tcg_out_qemu_st_direct X-Git-Tag: v8.1.5~9 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c173670033940211980fb78653f777fa1307d2a6;p=thirdparty%2Fqemu.git tcg/arm: Fix SIGILL in tcg_out_qemu_st_direct When tcg_out_qemu_st_{index,direct} were merged, the direct case for MO_64 was omitted, causing qemu_st_i64 to be encoded as 0xffffffff due to underflow when adding h.base and h.index. Fixes: 1df6d611bdc2 ("tcg/arm: Introduce HostAddress") Signed-off-by: Joseph Burt Message-Id: <20240121211439.100829-1-caseorum@gmail.com> Reviewed-by: Richard Henderson Signed-off-by: Richard Henderson (cherry picked from commit 9f6523e8e4689cafdbed7c10b7cf7c775b5a607b) Signed-off-by: Michael Tokarev --- diff --git a/tcg/arm/tcg-target.c.inc b/tcg/arm/tcg-target.c.inc index 83e286088f0..1864b8054fe 100644 --- a/tcg/arm/tcg-target.c.inc +++ b/tcg/arm/tcg-target.c.inc @@ -1667,6 +1667,9 @@ static void tcg_out_qemu_st_direct(TCGContext *s, MemOp opc, TCGReg datalo, } else { tcg_out_strd_r(s, h.cond, datalo, h.base, h.index); } + } else if (h.index < 0) { + tcg_out_st32_12(s, h.cond, datalo, h.base, 0); + tcg_out_st32_12(s, h.cond, datahi, h.base, 4); } else if (h.index_scratch) { tcg_out_st32_rwb(s, h.cond, datalo, h.index, h.base); tcg_out_st32_12(s, h.cond, datahi, h.index, 4);