diff options
author | Daniel Henrique Barboza <danielhb413@gmail.com> | 2022-06-02 11:14:49 -0300 |
---|---|---|
committer | Daniel Henrique Barboza <danielhb413@gmail.com> | 2022-06-20 08:38:58 -0300 |
commit | feeef6b6dd971be34e6e608c90238f65c935d846 (patch) | |
tree | 9881914212e9e1b1b627c51ae5e8b90b62a60ee0 /crypto/random-platform.c | |
parent | 78d6b5d33a1d0fcf485ecba684f03c13527800e4 (diff) | |
download | qemu-feeef6b6dd971be34e6e608c90238f65c935d846.zip qemu-feeef6b6dd971be34e6e608c90238f65c935d846.tar.gz qemu-feeef6b6dd971be34e6e608c90238f65c935d846.tar.bz2 |
target/ppc: avoid int32 multiply overflow in int_helper.c
Coverity is not thrilled about the multiply operations being done in
ger_rank8() and ger_rank2(), giving an error like the following:
Integer handling issues (OVERFLOW_BEFORE_WIDEN)
Potentially overflowing expression "sextract32(a, 4 * i, 4) *
sextract32(b, 4 * i, 4)" with type "int" (32 bits, signed) is evaluated
using 32-bit arithmetic, and then used in a context that expects an
expression of type "int64_t" (64 bits, signed).
Fix both instances where this occur by adding an int64_t cast in the
first operand, forcing the result to be 64 bit.
Fixes: Coverity CID 1489444, 1489443
Fixes: 345531533f26 ("target/ppc: Implemented xvi*ger* instructions")
Cc: Lucas Mateus Castro (alqotel) <lucas.araujo@eldorado.org.br>
Cc: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Lucas Mateus Castro (alqotel) <lucas.araujo@eldorado.org.br>
Message-Id: <20220602141449.118173-1-danielhb413@gmail.com>
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Diffstat (limited to 'crypto/random-platform.c')
0 files changed, 0 insertions, 0 deletions