ir_to_mesa: Don't assume that an ir_dereference_array is of a variable.
authorEric Anholt <eric@anholt.net>
Thu, 26 Aug 2010 18:23:09 +0000 (11:23 -0700)
committerEric Anholt <eric@anholt.net>
Thu, 26 Aug 2010 18:23:09 +0000 (11:23 -0700)
Fixes:
glsl-array-bounds-02 (software)
glsl-array-bounds-04
glsl-array-bounds-06 (software)
glsl-array-bounds-08

src/mesa/program/ir_to_mesa.cpp

index 7fb59749467a81d5723e005a1e935d1a736e072e..948f09a851cde25ded3fe7980894347d9df88de2 100644 (file)
@@ -1382,7 +1382,8 @@ ir_to_mesa_visitor::visit(ir_dereference_array *ir)
       return;
    }
 
-   if (strncmp(var->name, "gl_", 3) == 0 && var->mode == ir_var_uniform &&
+   if (var &&
+       strncmp(var->name, "gl_", 3) == 0 && var->mode == ir_var_uniform &&
        !var->type->is_matrix()) {
       ir_dereference_record *record = NULL;
       if (ir->array->ir_type == ir_type_dereference_record)