mirror of git://gcc.gnu.org/git/gcc.git
Taking a slice of an array requires moving the array to the heap.
From-SVN: r171792
This commit is contained in:
parent
34ccb9c02a
commit
9ebd2806f6
|
|
@ -9283,10 +9283,13 @@ Array_index_expression::do_check_types(Gogo*)
|
||||||
|
|
||||||
// A slice of an array requires an addressable array. A slice of a
|
// A slice of an array requires an addressable array. A slice of a
|
||||||
// slice is always possible.
|
// slice is always possible.
|
||||||
if (this->end_ != NULL
|
if (this->end_ != NULL && !array_type->is_open_array_type())
|
||||||
&& !array_type->is_open_array_type()
|
{
|
||||||
&& !this->array_->is_addressable())
|
if (!this->array_->is_addressable())
|
||||||
this->report_error(_("array is not addressable"));
|
this->report_error(_("array is not addressable"));
|
||||||
|
else
|
||||||
|
this->array_->address_taken(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Return whether this expression is addressable.
|
// Return whether this expression is addressable.
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue