glsl2: Fix ir_validate validating null variable names.
authorEric Anholt <eric@anholt.net>
Tue, 3 Aug 2010 18:43:25 +0000 (11:43 -0700)
committerEric Anholt <eric@anholt.net>
Tue, 3 Aug 2010 18:47:02 +0000 (11:47 -0700)
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

index 712e1376fa11f42535b29d7f237bcda2e80c2fb2..89bcd1c48117a82c01c469ad94ef4904f6fe3fc6 100644 (file)
@@ -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;