Mesa (glsl2): glsl2: Don't bounds check unsize array redeclarations

Ian Romanick idr at kemper.freedesktop.org
Fri Jul 2 03:43:39 UTC 2010


Module: Mesa
Branch: glsl2
Commit: 12873fa4e332959295154edfe957c0af79af5e74
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=12873fa4e332959295154edfe957c0af79af5e74

Author: Ian Romanick <ian.d.romanick at intel.com>
Date:   Thu Jul  1 14:10:19 2010 -0700

glsl2: Don't bounds check unsize array redeclarations

This along with several previous commits fix test CorrectUnsizedArray.frag.

---

 src/glsl/ast_to_hir.cpp |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp
index fc5a652..3a7fcf1 100644
--- a/src/glsl/ast_to_hir.cpp
+++ b/src/glsl/ast_to_hir.cpp
@@ -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 "




More information about the mesa-commit mailing list