Skip to content

Commit

Permalink
tcg/tci: Use tcg_out_ldst in tcg_out_st
Browse files Browse the repository at this point in the history
The tcg_out_ldst helper will handle out-of-range offsets.
We haven't actually encountered any, since we haven't run
across the assert within tcg_out_op_rrs, but an out-of-range
offset would not be impossible in future.

Fixes: 6508988 ("tcg/tci: Change encoding to uint32_t units")
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
  • Loading branch information
rth7680 committed Feb 28, 2022
1 parent 5b7b197 commit 2ccf40f
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions tcg/tci/tcg-target.c.inc
Expand Up @@ -790,14 +790,13 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc,
static void tcg_out_st(TCGContext *s, TCGType type, TCGReg val, TCGReg base,
intptr_t offset)
{
stack_bounds_check(base, offset);
switch (type) {
case TCG_TYPE_I32:
tcg_out_op_rrs(s, INDEX_op_st_i32, val, base, offset);
tcg_out_ldst(s, INDEX_op_st_i32, val, base, offset);
break;
#if TCG_TARGET_REG_BITS == 64
case TCG_TYPE_I64:
tcg_out_op_rrs(s, INDEX_op_st_i64, val, base, offset);
tcg_out_ldst(s, INDEX_op_st_i64, val, base, offset);
break;
#endif
default:
Expand Down

0 comments on commit 2ccf40f

Please sign in to comment.