OSDN Git Service

Don't crash if append arguments are erroneous.
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 4 Jan 2011 22:54:05 +0000 (22:54 +0000)
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 4 Jan 2011 22:54:05 +0000 (22:54 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@168489 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/go/gofrontend/expressions.cc

index 840fdb3..a7b5bbf 100644 (file)
@@ -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,