]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: eliminate repetitive code
authorwangyuntao <ytcoode@gmail.com>
Fri, 16 Jul 2021 10:29:05 +0000 (10:29 +0000)
committerMatthew Dempsky <mdempsky@google.com>
Fri, 27 Aug 2021 01:08:12 +0000 (01:08 +0000)
Change-Id: I02c8b65f7c1c1606c9964ab6c54d5ab5f1b444a5
GitHub-Last-Rev: 3d740b9ac129d38981ee295456d2d7f803a79b77
GitHub-Pull-Request: golang/go#47242
Reviewed-on: https://go-review.googlesource.com/c/go/+/334990
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Trust: Cuong Manh Le <cuong.manhle.vn@gmail.com>

src/cmd/compile/internal/ir/scc.go

index 2cfceaa1f627fa1e4d7773b828278ecd94dd902f..a42951c1dda2de5676c496e1b9cfe45971e54ed5 100644 (file)
@@ -116,12 +116,11 @@ func (v *bottomUpVisitor) visit(n *Func) uint32 {
                var i int
                for i = len(v.stack) - 1; i >= 0; i-- {
                        x := v.stack[i]
+                       v.nodeID[x] = ^uint32(0)
                        if x == n {
                                break
                        }
-                       v.nodeID[x] = ^uint32(0)
                }
-               v.nodeID[n] = ^uint32(0)
                block := v.stack[i:]
                // Run escape analysis on this set of functions.
                v.stack = v.stack[:i]