]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: fix reslice
authorKeith Randall <khr@golang.org>
Sun, 1 May 2016 05:28:37 +0000 (22:28 -0700)
committerKeith Randall <khr@golang.org>
Sun, 1 May 2016 22:11:45 +0000 (22:11 +0000)
:= 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: Minux Ma <minux@golang.org>
src/cmd/compile/internal/ssa/regalloc.go

index 65c25dfc5acbb619d3540e32d9218b6078f1c8c1..909ccf41d4ebcf84d96589ac6ca469c69c95db10 100644 (file)
@@ -2065,7 +2065,7 @@ func (s *regAllocState) computeLive() {
 
                        // Propagate backwards to the start of the block
                        // Assumes Values have been scheduled.
-                       phis := phis[:0]
+                       phis = phis[:0]
                        for i := len(b.Values) - 1; i >= 0; i-- {
                                v := b.Values[i]
                                live.remove(v.ID)