compiler: fix slice/array evaluation order bug
authorIan Lance Taylor <ian@gcc.gnu.org>
Sun, 30 Oct 2016 16:48:37 +0000 (16:48 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Sun, 30 Oct 2016 16:48:37 +0000 (16:48 +0000)
commite9d33505a09b5503ff8816ae970c47ce30684447
treedbe8fdb330eeb1b6785b676fd16430ff6fb88892
parent48e21b40b5549ddcf2a3e20cde612ed5c52ed3c2
compiler: fix slice/array evaluation order bug

    There was a phase ordering issue in the handling of "keyed" array
    literal expressions: the lowering phase was canonicalizing the
    indices/vals before the phase that fixed evaluation order, meaning that
    the evaluation order was incorrect. The fix is to capture the orginal
    ordering and use that ordering when doing traversals (there is already
    something similar being done for struct literal expressions).

    Fixes golang/go#17640

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

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