Commit 6a85804b by Ian Lance Taylor

re PR go/61264 (gccgo: ICE in __normal_iterator [GoSmith])

	PR go/61264
compiler: Fix copying behavior for empty composite literals.

From-SVN: r218789
parent 8c54c36b
...@@ -11588,7 +11588,10 @@ class Struct_construction_expression : public Expression ...@@ -11588,7 +11588,10 @@ class Struct_construction_expression : public Expression
do_copy() do_copy()
{ {
Struct_construction_expression* ret = Struct_construction_expression* ret =
new Struct_construction_expression(this->type_, this->vals_->copy(), new Struct_construction_expression(this->type_,
(this->vals_ == NULL
? NULL
: this->vals_->copy()),
this->location()); this->location());
if (this->traverse_order_ != NULL) if (this->traverse_order_ != NULL)
ret->set_traverse_order(this->traverse_order_); ret->set_traverse_order(this->traverse_order_);
...@@ -12353,7 +12356,10 @@ class Map_construction_expression : public Expression ...@@ -12353,7 +12356,10 @@ class Map_construction_expression : public Expression
Expression* Expression*
do_copy() do_copy()
{ {
return new Map_construction_expression(this->type_, this->vals_->copy(), return new Map_construction_expression(this->type_,
(this->vals_ == NULL
? NULL
: this->vals_->copy()),
this->location()); this->location());
} }
......
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