glsl2: Don't bounds check unsize array redeclarations
authorIan Romanick <ian.d.romanick@intel.com>
Thu, 1 Jul 2010 21:10:19 +0000 (14:10 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Thu, 1 Jul 2010 21:10:19 +0000 (14:10 -0700)
This along with several previous commits fix test CorrectUnsizedArray.frag.

src/glsl/ast_to_hir.cpp

index fc5a652..3a7fcf1 100644 (file)
@@ -1826,7 +1826,7 @@ ast_declarator_list::hir(exec_list *instructions,
               _mesa_glsl_error(& loc, state, "`gl_TexCoord' array size cannot "
                                "be larger than gl_MaxTextureCoords (%u)\n",
                                state->Const.MaxTextureCoords);
-           } else if (size <= earlier->max_array_access) {
+           } else if ((size > 0) && (size <= earlier->max_array_access)) {
               YYLTYPE loc = this->get_location();
 
               _mesa_glsl_error(& loc, state, "array size must be > %u due to "