Fix order of operations for implicit casts

This commit is contained in:
Bill Currie 2020-02-23 23:18:31 +09:00
parent 05f6ddbb13
commit 5374798ef9

View file

@ -956,9 +956,6 @@ binary_expr (int op, expr_t *e1, expr_t *e2)
}
}
et1 = low_level_type (t1);
et2 = low_level_type (t2);
if (is_constant (e1) && is_double (t1) && e1->implicit && is_float (t2)) {
t1 = &type_float;
convert_double (e1);
@ -968,6 +965,9 @@ binary_expr (int op, expr_t *e1, expr_t *e2)
convert_double (e2);
}
et1 = low_level_type (t1);
et2 = low_level_type (t2);
if (et1 >= ev_type_count || !binary_expr_types[et1])
return invalid_binary_expr(op, e1, e2);
if (et2 >= ev_type_count || !binary_expr_types[et1][et2])