From e6156df53a58b820e9b49f02bca53569d5b4be9f Mon Sep 17 00:00:00 2001 From: Krzysztof Kurek Date: Wed, 8 Nov 2023 20:28:22 +0100 Subject: [PATCH] panfrost: fix shift overflow in `bi_fold_constant` closes https://gitlab.freedesktop.org/mesa/mesa/-/issues/9517 Reviewed-by: Erik Faye-Lund Part-of: --- src/panfrost/compiler/bi_opt_constant_fold.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/panfrost/compiler/bi_opt_constant_fold.c b/src/panfrost/compiler/bi_opt_constant_fold.c index 92776fdcbac..df30cd78454 100644 --- a/src/panfrost/compiler/bi_opt_constant_fold.c +++ b/src/panfrost/compiler/bi_opt_constant_fold.c @@ -72,7 +72,7 @@ bi_fold_constant(bi_instr *I, bool *unsupported) if (I->not_result || I->src[0].neg || I->src[1].neg) break; - return (a << c) | b; + return (a << (c & 0x1F)) | b; case BI_OPCODE_F32_TO_U32: if (I->round == BI_ROUND_NONE) {