aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/glsl/ir_validate.cpp
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2011-03-28 12:59:46 +0000
committermarha <marha@users.sourceforge.net>2011-03-28 12:59:46 +0000
commit3015123fd2904d907896b1aefbe32c267baa2dc2 (patch)
tree3adc12a65779305c5fb676be577667ff7e33c389 /mesalib/src/glsl/ir_validate.cpp
parent0d9293f57738117231d77df831b6569d4f0739f2 (diff)
parent0b9b391c5a7acb31e5d8061169649043a38d6d0e (diff)
downloadvcxsrv-3015123fd2904d907896b1aefbe32c267baa2dc2.tar.gz
vcxsrv-3015123fd2904d907896b1aefbe32c267baa2dc2.tar.bz2
vcxsrv-3015123fd2904d907896b1aefbe32c267baa2dc2.zip
svn merge ^/branches/released .
Diffstat (limited to 'mesalib/src/glsl/ir_validate.cpp')
-rw-r--r--mesalib/src/glsl/ir_validate.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/mesalib/src/glsl/ir_validate.cpp b/mesalib/src/glsl/ir_validate.cpp
index fe6ef8145..7757f5ecd 100644
--- a/mesalib/src/glsl/ir_validate.cpp
+++ b/mesalib/src/glsl/ir_validate.cpp
@@ -473,6 +473,21 @@ ir_validate::visit(ir_variable *ir)
assert(ralloc_parent(ir->name) == ir);
hash_table_insert(ht, ir, ir);
+
+
+ /* If a variable is an array, verify that the maximum array index is in
+ * bounds. There was once an error in AST-to-HIR conversion that set this
+ * to be out of bounds.
+ */
+ if (ir->type->array_size() > 0) {
+ if (ir->max_array_access >= ir->type->length) {
+ printf("ir_variable has maximum access out of bounds (%d vs %d)\n",
+ ir->max_array_access, ir->type->length - 1);
+ ir->print();
+ abort();
+ }
+ }
+
return visit_continue;
}