From bf783ecea69c6b4a3fb5f616e91707cf6d806040 Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Wed, 28 Apr 2010 13:16:31 -0700 Subject: [PATCH] ir_reader: Slightly better error message when failing to read swizzles. --- ir_reader.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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 * -- 2.30.2