nv50/ir: avoid array overrun when checking for supported mods

Reported by Coverity

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.2 10.3" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 874a9396c5)
This commit is contained in:
Ilia Mirkin 2014-09-06 11:41:36 -04:00 committed by Emil Velikov
parent a318e2f383
commit 31adc40680
2 changed files with 2 additions and 2 deletions

View file

@ -449,7 +449,7 @@ TargetNV50::isModSupported(const Instruction *insn, int s, Modifier mod) const
return false;
}
}
if (s > 3)
if (s >= 3)
return false;
return (mod & Modifier(opInfo[insn->op].srcMods[s])) == mod;
}

View file

@ -423,7 +423,7 @@ TargetNVC0::isModSupported(const Instruction *insn, int s, Modifier mod) const
return false;
}
}
if (s > 3)
if (s >= 3)
return false;
return (mod & Modifier(opInfo[insn->op].srcMods[s])) == mod;
}