From c36f3f2db823337955d5a866d66556a69901da0b Mon Sep 17 00:00:00 2001 From: M Henning Date: Sun, 20 Mar 2022 00:23:46 -0400 Subject: [PATCH] nouveau: Fix out-of-bounds access in AlgebraicOpt for cases where we calculate the absolute value of the result of a unary operation We can remove this problematic check since it's redundant with the one several lines down. Reviewed-by: Ilia Mirkin Part-of: --- src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp index 42b2d0cd972..c440670b3be 100644 --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp @@ -1835,9 +1835,6 @@ AlgebraicOpt::handleABS(Instruction *abs) if (!sub || !prog->getTarget()->isOpSupported(OP_SAD, abs->dType)) return; - // expect not to have mods yet, if we do, bail - if (sub->src(0).mod || sub->src(1).mod) - return; // hidden conversion ? ty = intTypeToSigned(sub->dType); if (abs->dType != abs->sType || ty != abs->sType)