Mesa (glsl2): glsl2: Fix ir_validate validating null variable names.

Eric Anholt anholt at kemper.freedesktop.org
Tue Aug 3 18:47:39 UTC 2010


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

Author: Eric Anholt <eric at anholt.net>
Date:   Tue Aug  3 11:43:25 2010 -0700

glsl2: Fix ir_validate validating null variable names.

An unnamed variable in a prototype will have a NULL ->name, so don't
worry about storage then.

Fixes:
CorrectFunction1.vert
CorrectParse1.frag

---

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

diff --git a/src/glsl/ir_validate.cpp b/src/glsl/ir_validate.cpp
index 712e137..89bcd1c 100644
--- a/src/glsl/ir_validate.cpp
+++ b/src/glsl/ir_validate.cpp
@@ -313,7 +313,8 @@ ir_validate::visit(ir_variable *ir)
     * in the ir_dereference_variable handler to ensure that a variable is
     * declared before it is dereferenced.
     */
-   assert(talloc_parent(ir->name) == ir);
+   if (ir->name)
+      assert(talloc_parent(ir->name) == ir);
 
    hash_table_insert(ht, ir, ir);
    return visit_continue;




More information about the mesa-commit mailing list