summaryrefslogtreecommitdiff
path: root/ir.cpp
diff options
context:
space:
mode:
authorIan Romanick <ian.d.romanick@intel.com>2010-04-01 18:31:11 -0700
committerIan Romanick <ian.d.romanick@intel.com>2010-04-01 18:35:08 -0700
commitb8a21cc6df7e9da15a24ed3dbf60cd4aeb8effaa (patch)
tree35093f0e280535046c4784b24b2c7f73b271fea2 /ir.cpp
parent27e3cf8c0d8812f9be55ca6ceb52cf8232742d99 (diff)
Track max accessed array element, reject additional out-of-bounds accesses
For unsized arrays, we can't flag out-of-bounds accesses until the array is redeclared with a size. Track the maximum accessed element and generate an error if the declaration specifies a size that would cause that access to be out-of-bounds. This causes the following tests to pass: glslparsertest/shaders/array10.frag
Diffstat (limited to 'ir.cpp')
-rw-r--r--ir.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/ir.cpp b/ir.cpp
index 60f34ca9be..3939e5a7b5 100644
--- a/ir.cpp
+++ b/ir.cpp
@@ -246,7 +246,7 @@ ir_swizzle::create(ir_rvalue *val, const char *str, unsigned vector_length)
ir_variable::ir_variable(const struct glsl_type *type, const char *name)
- : ir_instruction(), read_only(false), centroid(false), invariant(false),
+ : max_array_access(0), read_only(false), centroid(false), invariant(false),
mode(ir_var_auto), interpolation(ir_var_smooth)
{
this->type = type;