From: Iago Toral Quiroga Date: Fri, 9 May 2014 06:50:03 +0000 (+0200) Subject: glsl: Do not call lhs->variable_referenced() multiple times X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a143fbb3220e4c40cd2c75eca6f3e94fba0fe324;p=mesa.git glsl: Do not call lhs->variable_referenced() multiple times Instead take the result from the first call and use it where needed. Reviewed-by: Kenneth Graunke --- diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp index 7516c33e1df..0128b3f4e82 100644 --- a/src/glsl/ast_to_hir.cpp +++ b/src/glsl/ast_to_hir.cpp @@ -799,11 +799,10 @@ do_assignment(exec_list *instructions, struct _mesa_glsl_parse_state *state, "assignment to %s", non_lvalue_description); error_emitted = true; - } else if (lhs->variable_referenced() != NULL - && lhs->variable_referenced()->data.read_only) { + } else if (lhs_var != NULL && lhs_var->data.read_only) { _mesa_glsl_error(&lhs_loc, state, "assignment to read-only variable '%s'", - lhs->variable_referenced()->name); + lhs_var->name); error_emitted = true; } else if (lhs->type->is_array() && !state->check_version(120, 300, &lhs_loc,