Skip to content

Commit

Permalink
s390x/tcg: Fix BRASL with a large negative offset
Browse files Browse the repository at this point in the history
When RI2 is 0x80000000, qemu enters an infinite loop instead of jumping
backwards. Fix by adding a missing cast, like in in2_ri2().

Fixes: 8ac33cd ("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>
  • Loading branch information
iii-i authored and huth committed Mar 16, 2022
1 parent d0a1782 commit fc3dd86
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion target/s390x/tcg/translate.c
Expand Up @@ -1597,7 +1597,7 @@ static DisasJumpType op_bal(DisasContext *s, DisasOps *o)
static DisasJumpType op_basi(DisasContext *s, DisasOps *o)
{
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)
Expand Down

0 comments on commit fc3dd86

Please sign in to comment.