]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: fix unified IR shapifying recursive instantiated types
authorCuong Manh Le <cuong.manhle.vn@gmail.com>
Mon, 29 Aug 2022 10:25:32 +0000 (17:25 +0700)
committerGopher Robot <gobot@golang.org>
Tue, 30 Aug 2022 17:23:27 +0000 (17:23 +0000)
commitddc93a536faf4576d182cd3197b116d61d05c484
tree15b430fa0e677db158fe01574c95b5b29dd57187
parentc22865fcfa1ec434e5655c652c6376fa2d0eb821
cmd/compile: fix unified IR shapifying recursive instantiated types

Shape-based stenciling in unified IR is done by converting type argument
to its underlying type. So it agressively check that type argument is
not a TFORW. However, for recursive instantiated type argument, it may
still be a TFORW when shapifying happens. Thus the assertion failed,
causing the compiler crashing.

To fix it, just allow fully instantiated type when shapifying.

Fixes #54512
Fixes #54722

Change-Id: I527e3fd696388c8a37454e738f0324f0c2ec16cb
Reviewed-on: https://go-review.googlesource.com/c/go/+/426335
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-by: Heschi Kreinick <heschi@google.com>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
src/cmd/compile/internal/base/debug.go
src/cmd/compile/internal/noder/reader.go
test/fixedbugs/issue54722.go [new file with mode: 0644]
test/fixedbugs/issue54722b.go [new file with mode: 0644]
test/typeparam/nested.go