Skip to content

Commit

Permalink
tcg/arm: Fix SIGILL in tcg_out_qemu_st_direct
Browse files Browse the repository at this point in the history
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: 1df6d61 ("tcg/arm: Introduce HostAddress")
Signed-off-by: Joseph Burt <caseorum@gmail.com>
Message-Id: <20240121211439.100829-1-caseorum@gmail.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
(cherry picked from commit 9f6523e)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
  • Loading branch information
caseorum authored and Michael Tokarev committed Jan 25, 2024
1 parent 76a9da3 commit c173670
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tcg/arm/tcg-target.c.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit c173670

Please sign in to comment.