diff options
author | marha <marha@users.sourceforge.net> | 2011-03-28 12:59:46 +0000 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2011-03-28 12:59:46 +0000 |
commit | 3015123fd2904d907896b1aefbe32c267baa2dc2 (patch) | |
tree | 3adc12a65779305c5fb676be577667ff7e33c389 /mesalib/src/glsl/ir_validate.cpp | |
parent | 0d9293f57738117231d77df831b6569d4f0739f2 (diff) | |
parent | 0b9b391c5a7acb31e5d8061169649043a38d6d0e (diff) | |
download | vcxsrv-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.cpp | 15 |
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;
}
|