Mesa (mesa_7_7_branch): glsl: use varName variable in _slang_gen_assignment ()

Brian Paul brianp at kemper.freedesktop.org
Mon Jan 4 10:30:26 PST 2010


Module: Mesa
Branch: mesa_7_7_branch
Commit: f52dd2ab333b0bdfa1df15bffb8156350c93f892
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=f52dd2ab333b0bdfa1df15bffb8156350c93f892

Author: Brian Paul <brianp at vmware.com>
Date:   Tue Dec 29 10:26:28 2009 -0700

glsl: use varName variable in _slang_gen_assignment()

---

 src/mesa/shader/slang/slang_codegen.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/mesa/shader/slang/slang_codegen.c b/src/mesa/shader/slang/slang_codegen.c
index b62cfc3..372a9ac 100644
--- a/src/mesa/shader/slang/slang_codegen.c
+++ b/src/mesa/shader/slang/slang_codegen.c
@@ -4249,14 +4249,15 @@ _slang_gen_assignment(slang_assemble_ctx * A, slang_operation *oper)
 
    if (oper->children[0].type == SLANG_OPER_IDENTIFIER) {
       /* Check that var is writeable */
+      const char *varName = (char *) oper->children[0].a_id;
       slang_variable *var
          = _slang_variable_locate(oper->children[0].locals,
                                   oper->children[0].a_id, GL_TRUE);
       if (!var) {
-         slang_info_log_error(A->log, "undefined variable '%s'",
-                              (char *) oper->children[0].a_id);
+         slang_info_log_error(A->log, "undefined variable '%s'", varName);
          return NULL;
       }
+
       if (var->type.qualifier == SLANG_QUAL_CONST ||
           var->type.qualifier == SLANG_QUAL_ATTRIBUTE ||
           var->type.qualifier == SLANG_QUAL_UNIFORM ||
@@ -4264,7 +4265,7 @@ _slang_gen_assignment(slang_assemble_ctx * A, slang_operation *oper)
            A->program->Target == GL_FRAGMENT_PROGRAM_ARB)) {
          slang_info_log_error(A->log,
                               "illegal assignment to read-only variable '%s'",
-                              (char *) oper->children[0].a_id);
+                              varName);
          return NULL;
       }
 



More information about the mesa-commit mailing list