mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-22 07:00:12 +01:00
Apply implicit conversions to ?: operator
This commit is contained in:
parent
212b0327b4
commit
db9be2e7aa
1 changed files with 5 additions and 5 deletions
|
|
@ -794,18 +794,18 @@ ast_expression::hir(exec_list *instructions,
|
||||||
* resulting matching type is the type of the entire
|
* resulting matching type is the type of the entire
|
||||||
* expression."
|
* expression."
|
||||||
*/
|
*/
|
||||||
/* FINISHME: Apply implicit conversions */
|
if ((!apply_implicit_conversion(op[1]->type, & op[2], state)
|
||||||
if (op[1]->type == op[2]->type) {
|
&& !apply_implicit_conversion(op[2]->type, & op[1], state))
|
||||||
tmp->type = op[1]->type;
|
|| (op[1]->type != op[2]->type)) {
|
||||||
} else {
|
|
||||||
YYLTYPE loc = this->subexpressions[1]->get_location();
|
YYLTYPE loc = this->subexpressions[1]->get_location();
|
||||||
|
|
||||||
_mesa_glsl_error(& loc, state, "Second and third operands of ?: "
|
_mesa_glsl_error(& loc, state, "Second and third operands of ?: "
|
||||||
"operator must have matching types.");
|
"operator must have matching types.");
|
||||||
error_emitted = true;
|
error_emitted = true;
|
||||||
|
} else {
|
||||||
|
tmp->type = op[1]->type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
result = new ir_dereference(tmp);
|
result = new ir_dereference(tmp);
|
||||||
type = tmp->type;
|
type = tmp->type;
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue