diff options
author | Richard Henderson | 2022-04-01 21:36:59 +0200 |
---|---|---|
committer | Richard Henderson | 2022-04-27 04:58:43 +0200 |
commit | 21641ee5a9b31568c990c7fc949eeb9bcd0f6a0f (patch) | |
tree | 002db74e221dc0bdc25db07779fc9fc3668171bd | |
parent | accel/tcg: Assert mmu_idx in range before use in cputlb (diff) | |
download | qemu-21641ee5a9b31568c990c7fc949eeb9bcd0f6a0f.tar.gz qemu-21641ee5a9b31568c990c7fc949eeb9bcd0f6a0f.tar.xz qemu-21641ee5a9b31568c990c7fc949eeb9bcd0f6a0f.zip |
target/s390x: Fix the accumulation of ccm in op_icm
Coverity rightly reports that 0xff << pos can overflow.
This would affect the ICMH instruction.
Fixes: Coverity CID 1487161
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20220401193659.332079-1-richard.henderson@linaro.org>
-rw-r--r-- | target/s390x/tcg/translate.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/target/s390x/tcg/translate.c b/target/s390x/tcg/translate.c index ae70368966..8f092dab95 100644 --- a/target/s390x/tcg/translate.c +++ b/target/s390x/tcg/translate.c @@ -2622,7 +2622,7 @@ static DisasJumpType op_icm(DisasContext *s, DisasOps *o) tcg_gen_qemu_ld8u(tmp, o->in2, get_mem_index(s)); tcg_gen_addi_i64(o->in2, o->in2, 1); tcg_gen_deposit_i64(o->out, o->out, tmp, pos, 8); - ccm |= 0xff << pos; + ccm |= 0xffull << pos; } m3 = (m3 << 1) & 0xf; pos -= 8; |