From 81f4f0e912775d11df35220ea598e54c272073fd Mon Sep 17 00:00:00 2001 From: Matthew Dempsky Date: Tue, 5 Jan 2021 11:53:00 -0800 Subject: [PATCH] [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 --- src/cmd/compile/internal/ir/name.go | 3 --- 1 file changed, 3 deletions(-) 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 } -- 2.50.0