From: Kenneth Graunke Date: Wed, 28 Apr 2010 20:16:31 +0000 (-0700) Subject: ir_reader: Slightly better error message when failing to read swizzles. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=bf783ecea69c6b4a3fb5f616e91707cf6d806040;p=mesa.git ir_reader: Slightly better error message when failing to read swizzles. --- diff --git a/ir_reader.cpp b/ir_reader.cpp index e7625736776..2c942914aef 100644 --- a/ir_reader.cpp +++ b/ir_reader.cpp @@ -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 *