mirror of
https://github.com/golang/go.git
synced 2026-02-05 02:15:06 +03: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:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user