glsl: Fix segfault due to missing printf argument
authorChad Versace <chad.versace@intel.com>
Tue, 18 Jan 2011 23:15:19 +0000 (15:15 -0800)
committerChad Versace <chad.versace@intel.com>
Tue, 18 Jan 2011 23:23:18 +0000 (15:23 -0800)
Fixes the following Piglit tests:
glslparsertest/shaders/array2.frag
glslparsertest/shaders/dataType6.frag

NOTE: This is a candidate for the 7.9 and 7.10 branches.

src/glsl/ast_to_hir.cpp

index 477efade814bb93055625937f28b828fb1ab27be..7a171f3a2bbb627008c2d6abb704559e2495acbb 100644 (file)
@@ -2509,7 +2509,8 @@ ast_declarator_list::hir(exec_list *instructions,
        */
       if (this->type->qualifier.flags.q.constant && decl->initializer == NULL) {
         _mesa_glsl_error(& loc, state,
-                         "const declaration of `%s' must be initialized");
+                         "const declaration of `%s' must be initialized",
+                         decl->identifier);
       }
 
       /* Check if this declaration is actually a re-declaration, either to