aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2011-01-04 22:54:05 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2011-01-04 22:54:05 +0000
commitc7f15f802ae87838bdd4491189a4c9fa7d31040e (patch)
treef88415eee4e8eb19de20289fe4c00a3740fa641b /gcc
parentd5d4d14e156d91fa4f5490eee269b6fc01b12160 (diff)
downloadgcc-c7f15f802ae87838bdd4491189a4c9fa7d31040e.zip
gcc-c7f15f802ae87838bdd4491189a4c9fa7d31040e.tar.gz
gcc-c7f15f802ae87838bdd4491189a4c9fa7d31040e.tar.bz2
Don't crash if append arguments are erroneous.
From-SVN: r168489
Diffstat (limited to 'gcc')
-rw-r--r--gcc/go/gofrontend/expressions.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/gcc/go/gofrontend/expressions.cc b/gcc/go/gofrontend/expressions.cc
index 840fdb3..a7b5bbf 100644
--- a/gcc/go/gofrontend/expressions.cc
+++ b/gcc/go/gofrontend/expressions.cc
@@ -7965,14 +7965,14 @@ Builtin_call_expression::do_get_tree(Translate_context* context)
Expression* arg1 = args->front();
Expression* arg2 = args->back();
- Array_type* at = arg1->type()->array_type();
- Type* element_type = at->element_type();
-
tree arg1_tree = arg1->get_tree(context);
tree arg2_tree = arg2->get_tree(context);
if (arg1_tree == error_mark_node || arg2_tree == error_mark_node)
return error_mark_node;
+ Array_type* at = arg1->type()->array_type();
+ Type* element_type = at->element_type();
+
arg2_tree = Expression::convert_for_assignment(context, at,
arg2->type(),
arg2_tree,