diff options
| author | Matthew Dempsky <mdempsky@google.com> | 2015-12-03 12:14:07 -0800 |
|---|---|---|
| committer | Matthew Dempsky <mdempsky@google.com> | 2015-12-03 21:29:22 +0000 |
| commit | 7a4022ee36ec1b45233f6d9ae19e336f8a64a215 (patch) | |
| tree | cc83349bd5eb9364446e6a9a7f705c460fd80605 /src | |
| parent | 70d558be8ff98c4d4eaa1ee78bf6ce6ad813ea5b (diff) | |
| download | go-7a4022ee36ec1b45233f6d9ae19e336f8a64a215.tar.xz | |
cmd/compile: fix live variable reuse in orderstmt
The call "poptemp(t, order)" at line 906 should match up with the
assignment "t := marktemp(order)" at line 770, so use a new temporary
variable for stripping the ODCL nodes from a "case x := <-ch" node's
Ninit list.
Fixes #13469.
Passes toolstash/buildall.
Change-Id: Ia7eabd40c79cfdcb83df00b6fbd0954e0c44c5c7
Reviewed-on: https://go-review.googlesource.com/17393
Reviewed-by: Keith Randall <khr@golang.org>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Diffstat (limited to 'src')
| -rw-r--r-- | src/cmd/compile/internal/gc/order.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/cmd/compile/internal/gc/order.go b/src/cmd/compile/internal/gc/order.go index 04ab2b0a84..84b96c2d7b 100644 --- a/src/cmd/compile/internal/gc/order.go +++ b/src/cmd/compile/internal/gc/order.go @@ -796,14 +796,14 @@ func orderstmt(n *Node, order *Order) { // Delete the ODCL nodes here and recreate them inside the body below. case OSELRECV, OSELRECV2: if r.Colas { - t = r.Ninit - if t != nil && t.N.Op == ODCL && t.N.Left == r.Left { - t = t.Next + init := r.Ninit + if init != nil && init.N.Op == ODCL && init.N.Left == r.Left { + init = init.Next } - if t != nil && t.N.Op == ODCL && r.List != nil && t.N.Left == r.List.N { - t = t.Next + if init != nil && init.N.Op == ODCL && r.List != nil && init.N.Left == r.List.N { + init = init.Next } - if t == nil { + if init == nil { r.Ninit = nil } } |
