ir_reader: Slightly better error message when failing to read swizzles.
authorKenneth Graunke <kenneth@whitecape.org>
Wed, 28 Apr 2010 20:16:31 +0000 (13:16 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Thu, 29 Apr 2010 01:14:54 +0000 (18:14 -0700)
ir_reader.cpp

index e7625736776b3da7a8820ee343f4240bfd1e0905..2c942914aefc5e933990c85b23cc0064493616ae 100644 (file)
@@ -725,8 +725,12 @@ read_swizzle(_mesa_glsl_parse_state *st, s_list *list)
    if (rvalue == NULL)
       return NULL;
 
-   return ir_swizzle::create(rvalue, swiz->value(),
-                            rvalue->type->vector_elements);
+   ir_swizzle *ir = ir_swizzle::create(rvalue, swiz->value(),
+                                      rvalue->type->vector_elements);
+   if (ir == NULL)
+      ir_read_error(st, list, "invalid swizzle");
+
+   return ir;
 }
 
 static ir_constant *