Commit ade0eb2f authored by Keith Randall's avatar Keith Randall

cmd/compile: fix reslice

:= is the wrong thing here.  The new variable masks the old
variable so we allocate the slice afresh each time around the loop.

Change-Id: I759c30e1bfa88f40decca6dd7d1e051e14ca0844
Reviewed-on: https://go-review.googlesource.com/22679
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: default avatarMinux Ma <minux@golang.org>
parent 24c05e7e
...@@ -2065,7 +2065,7 @@ func (s *regAllocState) computeLive() { ...@@ -2065,7 +2065,7 @@ func (s *regAllocState) computeLive() {
// Propagate backwards to the start of the block // Propagate backwards to the start of the block
// Assumes Values have been scheduled. // Assumes Values have been scheduled.
phis := phis[:0] phis = phis[:0]
for i := len(b.Values) - 1; i >= 0; i-- { for i := len(b.Values) - 1; i >= 0; i-- {
v := b.Values[i] v := b.Values[i]
live.remove(v.ID) live.remove(v.ID)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment