cmd/compile: mark shape type dupok

Fixes #52633

Change-Id: I3f19804cd7c00cee7e365062402c264d84b596c1
Reviewed-on: https://go-review.googlesource.com/c/go/+/403316
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Keith Randall <khr@google.com>
Auto-Submit: Keith Randall <khr@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
Run-TryBot: guangyuan zhou <zhouguangyuan@golangcn.org>
This commit is contained in:
zhouguangyuan 2022-05-01 00:11:13 +08:00 committed by Gopher Robot
parent 5a103ca5e9
commit 884530b374
1 changed files with 3 additions and 3 deletions

View File

@ -1199,10 +1199,10 @@ func writeType(t *types.Type) *obj.LSym {
// Note: DUPOK is required to ensure that we don't end up with more
// than one type descriptor for a given type, if the type descriptor
// can be defined in multiple packages, that is, unnamed types and
// instantiated types.
// can be defined in multiple packages, that is, unnamed types,
// instantiated types and shape types.
dupok := 0
if tbase.Sym() == nil || tbase.IsFullyInstantiated() {
if tbase.Sym() == nil || tbase.IsFullyInstantiated() || tbase.HasShape() {
dupok = obj.DUPOK
}