compiler: make Slice_construction_expression::do_flatten idempotent
authorIan Lance Taylor <ian@gcc.gnu.org>
Thu, 8 Dec 2016 15:51:25 +0000 (15:51 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Thu, 8 Dec 2016 15:51:25 +0000 (15:51 +0000)
commit55dccc1e0dbc8b975f5d14f151991f1c8412768e
tree916bbce811ecf95c3694babe08a797b550aaef06
parent04bfa1e4691afb9eb0edcd9e80ec1e542628c7d4
compiler: make Slice_construction_expression::do_flatten idempotent

    Because of the way we handle call expressions with multiple results,
    it's possible for expressions to be flattened more than once.  In the
    case of Slice_construction_expression, allocating the slice storage
    multiple times caused a compiler crash as one of the
    Temporary_statement's wound up not getting a backend expression.

    Test case is https://golang.org/cl/34020.

    Reviewed-on: https://go-review.googlesource.com/34026

From-SVN: r243442
gcc/go/gofrontend/MERGE
gcc/go/gofrontend/expressions.cc