From ade0eb2f0689b4d88d425451387c516013fd4b20 Mon Sep 17 00:00:00 2001 From: Keith Randall Date: Sat, 30 Apr 2016 22:28:37 -0700 Subject: [PATCH] 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 --- src/cmd/compile/internal/ssa/regalloc.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) -- 2.48.1