]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: workaround inlining of closures with type switches
authorMatthew Dempsky <mdempsky@google.com>
Sat, 24 Apr 2021 09:12:55 +0000 (02:12 -0700)
committerMatthew Dempsky <mdempsky@google.com>
Mon, 26 Apr 2021 21:27:41 +0000 (21:27 +0000)
commit9f601690da59e601ff68f9868d5eb863bd770eae
tree2f67e35635247aae34a3bc90d8771f7efcdd688e
parenta53dc4c1ce0e21da328bd5984900448bab354ba1
cmd/compile: workaround inlining of closures with type switches

Within clovar, n.Defn can also be *ir.TypeSwitchGuard. The proper fix
here would be to populate m.Defn and have it filled in too, but we
already leave it nil in inlvar. So for consistency, this CL does the
same in clovar too.

Eventually inl.go should be rewritten to fully respect IR invariants.

Fixes #45743.

Change-Id: I8b38e5d8b2329ad242de97670f2141f713954d28
Reviewed-on: https://go-review.googlesource.com/c/go/+/313289
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Dan Scales <danscales@google.com>
Trust: Dan Scales <danscales@google.com>
Trust: Cuong Manh Le <cuong.manhle.vn@gmail.com>
src/cmd/compile/internal/inline/inl.go
test/fixedbugs/issue45743.go [new file with mode: 0644]