]> Cypherpunks repositories - gostls13.git/commitdiff
[dev.regabi] cmd/compile: remove race-y check in Name.Canonical
authorMatthew Dempsky <mdempsky@google.com>
Tue, 5 Jan 2021 19:53:00 +0000 (11:53 -0800)
committerMatthew Dempsky <mdempsky@google.com>
Tue, 5 Jan 2021 20:12:02 +0000 (20:12 +0000)
The backend doesn't synchronize compilation of functions with their
enclosed function literals, so it's not safe to double-check that
IsClosureVar isn't set on the underlying Name. Plenty of frontend
stuff would blow-up if this was wrong anyway, so it should be fine to
omit.

Change-Id: I3e97b64051fe56d97bf316c9b5dcce61f2082428
Reviewed-on: https://go-review.googlesource.com/c/go/+/281812
Trust: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Than McIntosh <thanm@google.com>
TryBot-Result: Go Bot <gobot@golang.org>

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

index 9d7d376ba50d07bfbba5274bb38966cec9c8c5ab..3999c0ecb4a3368b66b0973d073b9182b7239985 100644 (file)
@@ -341,9 +341,6 @@ func (n *Name) SetVal(v constant.Value) {
 func (n *Name) Canonical() *Name {
        if n.IsClosureVar() {
                n = n.Defn.(*Name)
-               if n.IsClosureVar() {
-                       base.Fatalf("recursive closure variable: %v", n)
-               }
        }
        return n
 }