aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/glsl/opt_array_splitting.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'mesalib/src/glsl/opt_array_splitting.cpp')
-rw-r--r--mesalib/src/glsl/opt_array_splitting.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/mesalib/src/glsl/opt_array_splitting.cpp b/mesalib/src/glsl/opt_array_splitting.cpp
index ebb076b22..9e73f3c44 100644
--- a/mesalib/src/glsl/opt_array_splitting.cpp
+++ b/mesalib/src/glsl/opt_array_splitting.cpp
@@ -295,7 +295,7 @@ ir_array_splitting_visitor::split_deref(ir_dereference **deref)
ir_constant *constant = deref_array->array_index->as_constant();
assert(constant);
- if (constant->value.i[0] < (int)entry->size) {
+ if (constant->value.i[0] >= 0 && constant->value.i[0] < (int)entry->size) {
*deref = new(entry->mem_ctx)
ir_dereference_variable(entry->components[constant->value.i[0]]);
} else {