diff options
author | Eric Anholt <eric@anholt.net> | 2010-03-31 17:05:32 -1000 |
---|---|---|
committer | Ian Romanick <ian.d.romanick@intel.com> | 2010-04-02 11:22:41 -0700 |
commit | ebbf14b9801d577adf40dcb0b63df2d3b8da934e (patch) | |
tree | d8887721871f6f321f08f6ae96665a98d72ae8f2 | |
parent | 183d8c63947fcfab45c9f2a8a8a6fc311e8b1552 (diff) |
Fix error handling of logic operators.
They were always throwing a type error because type wasn't being set.
-rw-r--r-- | ast_to_hir.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/ast_to_hir.cpp b/ast_to_hir.cpp index 5d7c073ca9..79e04ee796 100644 --- a/ast_to_hir.cpp +++ b/ast_to_hir.cpp @@ -736,6 +736,7 @@ ast_expression::hir(exec_list *instructions, _mesa_glsl_error(& loc, state, "LHS of `%s' must be scalar boolean", operator_string(this->oper)); + error_emitted = true; } if (!op[1]->type->is_boolean() || !op[1]->type->is_scalar()) { @@ -743,10 +744,12 @@ ast_expression::hir(exec_list *instructions, _mesa_glsl_error(& loc, state, "RHS of `%s' must be scalar boolean", operator_string(this->oper)); + error_emitted = true; } result = new ir_expression(operations[this->oper], glsl_type::bool_type, op[0], op[1]); + type = glsl_type::bool_type; break; case ast_logic_not: @@ -757,10 +760,12 @@ ast_expression::hir(exec_list *instructions, _mesa_glsl_error(& loc, state, "operand of `!' must be scalar boolean"); + error_emitted = true; } result = new ir_expression(operations[this->oper], glsl_type::bool_type, op[0], NULL); + type = glsl_type::bool_type; break; case ast_mul_assign: |