]> xenbits.xensource.com Git - qemu-xen.git/commit
target/tricore: Use unsigned types for bitops in helper_eq_b()
authorPeter Maydell <peter.maydell@linaro.org>
Tue, 23 Jul 2024 15:10:42 +0000 (16:10 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Mon, 29 Jul 2024 15:57:27 +0000 (16:57 +0100)
commitb69c95e718ba83fac6d5d725c4a79c4da808ab67
tree23f91f226a642666a89201d2a6beb967698fdb95
parentf573ac059ed060234fcef4299fae9e500d357c33
target/tricore: Use unsigned types for bitops in helper_eq_b()

Coverity points out that in helper_eq_b() we have an int32_t 'msk'
and we end up shifting into its sign bit. This is OK for QEMU because
we use -fwrapv to give this well defined semantics, but when you look
at what this function is doing it's doing bit operations, so we
should be using an unsigned variable anyway. This also matches the
return type of the function.

Make 'ret' and 'msk' uint32_t.

Resolves: Coverity CID 1547758
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20240723151042.1396610-1-peter.maydell@linaro.org
target/tricore/op_helper.c