From: Kenneth Graunke Date: Tue, 15 Jul 2014 23:35:55 +0000 (-0700) Subject: glsl: Guard against error_type in the tree rebalancer. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=7db75927ca9f15bcbb28d23f9cfbc34541a51938;p=mesa.git glsl: Guard against error_type in the tree rebalancer. This helped me track down the bug fixed in the previous commit. Signed-off-by: Kenneth Graunke --- diff --git a/src/glsl/opt_rebalance_tree.cpp b/src/glsl/opt_rebalance_tree.cpp index 7ef0d2db392..f82b16b5412 100644 --- a/src/glsl/opt_rebalance_tree.cpp +++ b/src/glsl/opt_rebalance_tree.cpp @@ -271,11 +271,13 @@ update_types(ir_instruction *ir, void *) if (!expr) return; - expr->type = + const glsl_type *const new_type = glsl_type::get_instance(expr->type->base_type, MAX2(expr->operands[0]->type->components(), expr->operands[1]->type->components()), 1); + assert(new_type != glsl_type::error_type); + expr->type = new_type; } void