Commit 0a911509 by Ian Lance Taylor

compiler: Don't lower binary expressions with mismatched types.

From-SVN: r184352
parent f7b67575
...@@ -5564,6 +5564,7 @@ Binary_expression::do_lower(Gogo* gogo, Named_object*, ...@@ -5564,6 +5564,7 @@ Binary_expression::do_lower(Gogo* gogo, Named_object*,
&& op != OPERATOR_RSHIFT) && op != OPERATOR_RSHIFT)
{ {
// May be a type error--let it be diagnosed later. // May be a type error--let it be diagnosed later.
return this;
} }
else if (is_comparison) else if (is_comparison)
{ {
...@@ -5667,6 +5668,7 @@ Binary_expression::do_lower(Gogo* gogo, Named_object*, ...@@ -5667,6 +5668,7 @@ Binary_expression::do_lower(Gogo* gogo, Named_object*,
&& op != OPERATOR_RSHIFT) && op != OPERATOR_RSHIFT)
{ {
// May be a type error--let it be diagnosed later. // May be a type error--let it be diagnosed later.
return this;
} }
else if (is_comparison) else if (is_comparison)
{ {
...@@ -5750,6 +5752,7 @@ Binary_expression::do_lower(Gogo* gogo, Named_object*, ...@@ -5750,6 +5752,7 @@ Binary_expression::do_lower(Gogo* gogo, Named_object*,
&& left_type->base() != right_type->base()) && left_type->base() != right_type->base())
{ {
// May be a type error--let it be diagnosed later. // May be a type error--let it be diagnosed later.
return this;
} }
else if (op == OPERATOR_EQEQ || op == OPERATOR_NOTEQ) else if (op == OPERATOR_EQEQ || op == OPERATOR_NOTEQ)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment