From: Keith Randall Date: Sun, 1 May 2016 05:28:37 +0000 (-0700) Subject: cmd/compile: fix reslice X-Git-Tag: go1.7beta1~373 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=ade0eb2f0689b4d88d425451387c516013fd4b20;p=gostls13.git 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 TryBot-Result: Gobot Gobot Reviewed-by: Minux Ma --- diff --git a/src/cmd/compile/internal/ssa/regalloc.go b/src/cmd/compile/internal/ssa/regalloc.go index 65c25dfc5a..909ccf41d4 100644 --- a/src/cmd/compile/internal/ssa/regalloc.go +++ b/src/cmd/compile/internal/ssa/regalloc.go @@ -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)