summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2019-03-01 13:56:18 -0700
committerBrian Paul <[email protected]>2019-03-04 11:48:47 -0700
commit66ba12973bcbe35f7c41c32270f92073e946b1d5 (patch)
tree5d5e459e8dc824e070163502c8cbd5f8ac6dc19b /src
parent999db9ac51b312f8d18f5a39025f1b0dabddd073 (diff)
svga: silence array out of bounds warning
MinGW release build complains about a possible out-of-bounds array access. Test i < 4 to silence it. Reviewed-by: Neha Bhende <[email protected]> Reviewed-by: Mathias Fröhlich <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/svga/svga_tgsi_insn.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gallium/drivers/svga/svga_tgsi_insn.c b/src/gallium/drivers/svga/svga_tgsi_insn.c
index c7804b2680f..1392a3cc91f 100644
--- a/src/gallium/drivers/svga/svga_tgsi_insn.c
+++ b/src/gallium/drivers/svga/svga_tgsi_insn.c
@@ -2951,7 +2951,7 @@ svga_emit_immediate(struct svga_shader_emitter *emit,
unsigned i;
assert(1 <= imm->Immediate.NrTokens && imm->Immediate.NrTokens <= 5);
- for (i = 0; i < imm->Immediate.NrTokens - 1; i++) {
+ for (i = 0; i < 4 && i < imm->Immediate.NrTokens - 1; i++) {
float f = imm->u[i].Float;
value[i] = util_is_inf_or_nan(f) ? 0.0f : f;
}