summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorIlia Mirkin <imirkin@alum.mit.edu>2014-09-06 11:41:36 -0400
committerEmil Velikov <emil.l.velikov@gmail.com>2014-09-09 21:38:40 +0100
commit31adc4068091f71a6cee656224ecab32f0aa1746 (patch)
tree787e9c258563e4827d9377d260fc77d1ef08cdd0 /src
parenta318e2f383b3c02448cb4e0a7493343bcc47e793 (diff)
downloadmesa-31adc4068091f71a6cee656224ecab32f0aa1746.tar.gz
mesa-31adc4068091f71a6cee656224ecab32f0aa1746.tar.bz2
mesa-31adc4068091f71a6cee656224ecab32f0aa1746.zip
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 874a9396c5adfdcff63139bf6ababb55c1253402)
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/nouveau/codegen/nv50_ir_target_nv50.cpp2
-rw-r--r--src/gallium/drivers/nouveau/codegen/nv50_ir_target_nvc0.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_target_nv50.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_target_nv50.cpp
index b0d617affa7..ebcb0ac2a67 100644
--- a/src/gallium/drivers/nouveau/codegen/nv50_ir_target_nv50.cpp
+++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_target_nv50.cpp
@@ -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;
}
diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_target_nvc0.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_target_nvc0.cpp
index 963b6e47ddf..817ceb862d7 100644
--- a/src/gallium/drivers/nouveau/codegen/nv50_ir_target_nvc0.cpp
+++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_target_nvc0.cpp
@@ -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;
}