]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: mark shape type dupok
authorzhouguangyuan <zhouguangyuan.xian@gmail.com>
Sat, 30 Apr 2022 16:11:13 +0000 (00:11 +0800)
committerGopher Robot <gobot@golang.org>
Tue, 3 May 2022 19:04:56 +0000 (19:04 +0000)
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>

src/cmd/compile/internal/reflectdata/reflect.go

index a9f87baee2b5edf6f205785e2016181abd624f4b..d6e6b115a462a9cdde12fb2e5af5f35e9b9b0753 100644 (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
        }