]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: Ensure left-to-right assignment
authorDhananjay Nakrani <dhananjaynakrani@gmail.com>
Sat, 24 Dec 2016 06:28:45 +0000 (22:28 -0800)
committerKeith Randall <khr@golang.org>
Sat, 11 Feb 2017 21:46:21 +0000 (21:46 +0000)
commit1cde87b312c5687cd0d70457c48586055e8c53ca
tree108ff1267dbfffb9a212b8f97400a693e4e8358b
parente0d50a5830cbd17810cd488bf70d86fd0c2757ec
cmd/compile: Ensure left-to-right assignment

Add temporaries to reorder the assignment for OAS2XXX nodes.
This makes orderstmt(), rewrite
  a, b, c = ...
as
  tmp1, tmp2, tmp3 = ...
  a, b, c = tmp1, tmp2, tmp3
and
  a, ok = ...
as
  t1, t2 = ...
  a  = t1
  ok = t2

Fixes #13433.

Change-Id: Id0f5956e3a254d0a6f4b89b5f7b0e055b1f0e21f
Reviewed-on: https://go-review.googlesource.com/34713
Run-TryBot: Dhananjay Nakrani <dhananjayn@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
src/cmd/compile/internal/gc/order.go
test/reorder.go