target/arm: Move computation of index in handle_simd_dupe
commit550a04893c2bd4442211b353680b9a6408d94dba
authorRichard Henderson <richard.henderson@linaro.org>
Mon, 23 Mar 2020 17:22:30 +0000 (23 17:22 +0000)
committerPeter Maydell <peter.maydell@linaro.org>
Mon, 23 Mar 2020 17:22:30 +0000 (23 17:22 +0000)
treef94497b3d10d6ab3c8f2ca83d2a3ec73502b91ae
parent3944d58db3fc5bf131345a21a44013bc13849a12
target/arm: Move computation of index in handle_simd_dupe

Coverity reports a BAD_SHIFT with ctz32(imm5), with imm5 == 0.
This is an invalid encoding, but we diagnose that just below
by rejecting size > 3.  Avoid the warning by sinking the
computation of index below the check.

Reported-by: Coverity (CID 1421965)
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-id: 20200320160622.8040-4-richard.henderson@linaro.org
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
target/arm/translate-a64.c