From: Ian Romanick Date: Thu, 24 Mar 2011 23:50:23 +0000 (-0700) Subject: glsl: Fix off-by-one error setting max_array_access for non-constant indexing X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0d9d036004f135c38990c60f46074b70cff6e663;p=mesa.git glsl: Fix off-by-one error setting max_array_access for non-constant indexing NOTE: This is a candidate for the stable branches. --- diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp index cdb16fd492b..a1c76e834af 100644 --- a/src/glsl/ast_to_hir.cpp +++ b/src/glsl/ast_to_hir.cpp @@ -1577,7 +1577,7 @@ ast_expression::hir(exec_list *instructions, */ ir_variable *v = array->whole_variable_referenced(); if (v != NULL) - v->max_array_access = array->type->array_size(); + v->max_array_access = array->type->array_size() - 1; } }