aboutsummaryrefslogtreecommitdiff
path: root/gcc/go/gofrontend
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2012-03-08 01:38:55 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2012-03-08 01:38:55 +0000
commit2a4368af972061006fc4cb2d8957611ebeb65d65 (patch)
tree41f587ca44cd5c1de4f970c245c388370a21b708 /gcc/go/gofrontend
parent8ad8655c6e8f1d2eaf6ed277a58623f06da27598 (diff)
downloadgcc-2a4368af972061006fc4cb2d8957611ebeb65d65.zip
gcc-2a4368af972061006fc4cb2d8957611ebeb65d65.tar.gz
gcc-2a4368af972061006fc4cb2d8957611ebeb65d65.tar.bz2
compiler: Don't crash on array assignment.
From-SVN: r185092
Diffstat (limited to 'gcc/go/gofrontend')
-rw-r--r--gcc/go/gofrontend/expressions.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/go/gofrontend/expressions.cc b/gcc/go/gofrontend/expressions.cc
index a2097e0..134b5ae 100644
--- a/gcc/go/gofrontend/expressions.cc
+++ b/gcc/go/gofrontend/expressions.cc
@@ -284,8 +284,10 @@ Expression::convert_for_assignment(Translate_context* context, Type* lhs_type,
|| SCALAR_FLOAT_TYPE_P(lhs_type_tree)
|| COMPLEX_FLOAT_TYPE_P(lhs_type_tree))
return fold_convert_loc(location.gcc_location(), lhs_type_tree, rhs_tree);
- else if (TREE_CODE(lhs_type_tree) == RECORD_TYPE
- && TREE_CODE(TREE_TYPE(rhs_tree)) == RECORD_TYPE)
+ else if ((TREE_CODE(lhs_type_tree) == RECORD_TYPE
+ && TREE_CODE(TREE_TYPE(rhs_tree)) == RECORD_TYPE)
+ || (TREE_CODE(lhs_type_tree) == ARRAY_TYPE
+ && TREE_CODE(TREE_TYPE(rhs_tree)) == ARRAY_TYPE))
{
// This conversion must be permitted by Go, or we wouldn't have
// gotten here.