s390x/tcg: Fix BRASL with a large negative offset

When RI2 is 0x80000000, qemu enters an infinite loop instead of jumping
backwards. Fix by adding a missing cast, like in in2_ri2().

Fixes: 8ac33cdb8b ("Convert BRANCH AND SAVE")
Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
Message-Id: <20220314104232.675863-2-iii@linux.ibm.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
This commit is contained in:
Ilya Leoshkevich 2022-03-14 11:42:30 +01:00 committed by Thomas Huth
parent d0a17829d0
commit fc3dd86a29

View File

@ -1597,7 +1597,7 @@ static DisasJumpType op_bal(DisasContext *s, DisasOps *o)
static DisasJumpType op_basi(DisasContext *s, DisasOps *o) static DisasJumpType op_basi(DisasContext *s, DisasOps *o)
{ {
pc_to_link_info(o->out, s, s->pc_tmp); pc_to_link_info(o->out, s, s->pc_tmp);
return help_goto_direct(s, s->base.pc_next + 2 * get_field(s, i2)); return help_goto_direct(s, s->base.pc_next + (int64_t)get_field(s, i2) * 2);
} }
static DisasJumpType op_bc(DisasContext *s, DisasOps *o) static DisasJumpType op_bc(DisasContext *s, DisasOps *o)