Mesa (7.9): glsl: Fix segfault due to missing printf argument

Ian Romanick idr at kemper.freedesktop.org
Sat Feb 5 00:14:06 UTC 2011


Module: Mesa
Branch: 7.9
Commit: 3ddf406530f717ea99862282ebe67a3837b04b2f
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=3ddf406530f717ea99862282ebe67a3837b04b2f

Author: Chad Versace <chad.versace at intel.com>
Date:   Tue Jan 18 15:15:19 2011 -0800

glsl: Fix segfault due to missing printf argument

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.
(cherry picked from commit 46f7105df487c91569f7e4a8da74d673c12e5619)

---

 src/glsl/ast_to_hir.cpp |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp
index 9506c9e..eca6504 100644
--- a/src/glsl/ast_to_hir.cpp
+++ b/src/glsl/ast_to_hir.cpp
@@ -2149,7 +2149,8 @@ ast_declarator_list::hir(exec_list *instructions,
        */
       if (this->type->qualifier.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




More information about the mesa-commit mailing list