1
0
mirror of https://github.com/golang/go synced 2024-11-17 05:54:46 -07:00

[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 <mdempsky@google.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Than McIntosh <thanm@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
This commit is contained in:
Matthew Dempsky 2021-01-05 11:53:00 -08:00
parent 4a9d9adea4
commit 81f4f0e912

View 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
}