From: Matthew Dempsky Date: Tue, 5 Jan 2021 19:53:00 +0000 (-0800) Subject: [dev.regabi] cmd/compile: remove race-y check in Name.Canonical X-Git-Tag: go1.17beta1~1539^2~129 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=81f4f0e912;p=gostls13.git [dev.regabi] cmd/compile: remove race-y check in Name.Canonical 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 Run-TryBot: Matthew Dempsky Reviewed-by: Than McIntosh TryBot-Result: Go Bot --- diff --git a/src/cmd/compile/internal/ir/name.go b/src/cmd/compile/internal/ir/name.go index 9d7d376ba5..3999c0ecb4 100644 --- a/src/cmd/compile/internal/ir/name.go +++ b/src/cmd/compile/internal/ir/name.go @@ -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 }