compiler: fix evaluation order of LHS index expressions
commit71a38860b7824a170c9472d68b045c6372ecb52d
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 11 Jul 2018 14:22:12 +0000 (11 14:22 +0000)
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 11 Jul 2018 14:22:12 +0000 (11 14:22 +0000)
treebda3b9e97b0fab2129706a037775832f83e6982f
parent269d18cfcabe765fd900abfbf00504f7dd035540
compiler: fix evaluation order of LHS index expressions

    The spec says that when an index expression appears on the left hand
    side of an assignment, the operands should be evaluated. The
    gofrontend code was assuming that that only referred to the index
    operand. But discussion of https://golang.org/issue/23188 has
    clarified that this means both the slice/map/string operand and the
    index operand. Adjust the gofrontend code accordingly.

    Fixes golang/go#23188

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

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@262554 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/go/gofrontend/MERGE
gcc/go/gofrontend/expressions.cc
gcc/go/gofrontend/expressions.h