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 <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15476>
This commit is contained in:
M Henning 2022-03-20 00:23:46 -04:00 committed by Marge Bot
parent d12e16fc3b
commit c36f3f2db8

View file

@ -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)