aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/go/gofrontend/expressions.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/go/gofrontend/expressions.cc')
-rw-r--r--gcc-4.9/gcc/go/gofrontend/expressions.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/gcc-4.9/gcc/go/gofrontend/expressions.cc b/gcc-4.9/gcc/go/gofrontend/expressions.cc
index f45b4a227..b0b8e39e9 100644
--- a/gcc-4.9/gcc/go/gofrontend/expressions.cc
+++ b/gcc-4.9/gcc/go/gofrontend/expressions.cc
@@ -5341,10 +5341,13 @@ Binary_expression::do_lower(Gogo* gogo, Named_object*,
// Lower struct, array, and some interface comparisons.
if (op == OPERATOR_EQEQ || op == OPERATOR_NOTEQ)
{
- if (left->type()->struct_type() != NULL)
+ if (left->type()->struct_type() != NULL
+ && right->type()->struct_type() != NULL)
return this->lower_struct_comparison(gogo, inserter);
else if (left->type()->array_type() != NULL
- && !left->type()->is_slice_type())
+ && !left->type()->is_slice_type()
+ && right->type()->array_type() != NULL
+ && !right->type()->is_slice_type())
return this->lower_array_comparison(gogo, inserter);
else if ((left->type()->interface_type() != NULL
&& right->type()->interface_type() == NULL)