]> www.infradead.org Git - qemu-nvme.git/commitdiff
tcg/optimize: Add an extra cast to fold_extract2
authorRichard Henderson <richard.henderson@linaro.org>
Tue, 9 Nov 2021 22:17:59 +0000 (23:17 +0100)
committerRichard Henderson <richard.henderson@linaro.org>
Thu, 11 Nov 2021 10:47:01 +0000 (11:47 +0100)
There is no bug, but silence a warning about computation
in int32_t being assigned to a uint64_t.

Reported-by: Coverity CID 1465220
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
tcg/optimize.c

index dbb2d46e88561815c2a8efa304aa97710ee8a9f6..2397f2cf93ae1d1bc2c70ef63d48ef4bc1897f04 100644 (file)
@@ -1365,7 +1365,7 @@ static bool fold_extract2(OptContext *ctx, TCGOp *op)
             v2 <<= 64 - shr;
         } else {
             v1 = (uint32_t)v1 >> shr;
-            v2 = (int32_t)v2 << (32 - shr);
+            v2 = (uint64_t)((int32_t)v2 << (32 - shr));
         }
         return tcg_opt_gen_movi(ctx, op, op->args[0], v1 | v2);
     }