summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKenneth Graunke <kenneth@whitecape.org>2014-07-15 16:35:55 -0700
committerKenneth Graunke <kenneth@whitecape.org>2014-07-16 15:43:13 -0700
commit7db75927ca9f15bcbb28d23f9cfbc34541a51938 (patch)
tree2ef22a8196b5be6d91bb845d5f1bc3e61e2f42d7 /src
parent9697f8088f9e1c1b1f1b39b57a26ac4bd21b247f (diff)
downloadexternal_mesa3d-7db75927ca9f15bcbb28d23f9cfbc34541a51938.zip
external_mesa3d-7db75927ca9f15bcbb28d23f9cfbc34541a51938.tar.gz
external_mesa3d-7db75927ca9f15bcbb28d23f9cfbc34541a51938.tar.bz2
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 <kenneth@whitecape.org>
Diffstat (limited to 'src')
-rw-r--r--src/glsl/opt_rebalance_tree.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/glsl/opt_rebalance_tree.cpp b/src/glsl/opt_rebalance_tree.cpp
index 7ef0d2d..f82b16b 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