diff options
author | Ian Romanick <ian.d.romanick@intel.com> | 2010-03-29 16:25:56 -0700 |
---|---|---|
committer | Ian Romanick <ian.d.romanick@intel.com> | 2010-03-29 16:29:26 -0700 |
commit | db9be2e7aa3a56e43b725ad7725fe6b424e4933e (patch) | |
tree | 3e4896c28fe76c507713b836593f86f8687eb7bf | |
parent | 212b0327b47033442842a7be3d7fb10e08e2bf66 (diff) |
Apply implicit conversions to ?: operator
-rw-r--r-- | ast_to_hir.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/ast_to_hir.cpp b/ast_to_hir.cpp index 3450d3889c..dfb2e40ea3 100644 --- a/ast_to_hir.cpp +++ b/ast_to_hir.cpp @@ -794,18 +794,18 @@ ast_expression::hir(exec_list *instructions, * resulting matching type is the type of the entire * expression." */ - /* FINISHME: Apply implicit conversions */ - if (op[1]->type == op[2]->type) { - tmp->type = op[1]->type; - } else { + if ((!apply_implicit_conversion(op[1]->type, & op[2], state) + && !apply_implicit_conversion(op[2]->type, & op[1], state)) + || (op[1]->type != op[2]->type)) { YYLTYPE loc = this->subexpressions[1]->get_location(); _mesa_glsl_error(& loc, state, "Second and third operands of ?: " "operator must have matching types."); error_emitted = true; + } else { + tmp->type = op[1]->type; } - result = new ir_dereference(tmp); type = tmp->type; break; |