From 0d9d036004f135c38990c60f46074b70cff6e663 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Thu, 24 Mar 2011 16:50:23 -0700 Subject: [PATCH] glsl: Fix off-by-one error setting max_array_access for non-constant indexing NOTE: This is a candidate for the stable branches. --- src/glsl/ast_to_hir.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; } } -- 2.30.2