glsl: use 'declared_var' instead of 'var' after checking redeclarations
authorIago Toral Quiroga <itoral@igalia.com>
Wed, 13 Sep 2017 06:59:18 +0000 (08:59 +0200)
committerIago Toral Quiroga <itoral@igalia.com>
Thu, 14 Sep 2017 09:23:26 +0000 (11:23 +0200)
Since the original 'var' might have been deleted from this point forward.

Bugzila: https://bugs.freedesktop.org/show_bug.cgi?id=102685
Fixes: 51bf007d2c27fba (glsl: Disallow unsized array of atomic_uint)
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/compiler/glsl/ast_to_hir.cpp

index 9ded2cbda7f8948fd58450698578a05e634117f4..6dd0f1dfaad7f050cd9401a71625c74cc18beb91 100644 (file)
@@ -5547,8 +5547,8 @@ ast_declarator_list::hir(exec_list *instructions,
        *    "It is a compile-time error to declare an unsized array of
        *     atomic_uint"
        */
-      if (var->type->is_unsized_array() &&
-          var->type->without_array()->base_type == GLSL_TYPE_ATOMIC_UINT) {
+      if (declared_var->type->is_unsized_array() &&
+          declared_var->type->without_array()->base_type == GLSL_TYPE_ATOMIC_UINT) {
          _mesa_glsl_error(& loc, state,
                           "Unsized array of atomic_uint is not allowed");
       }