From 884530b374501b997422d08833c2a21966bd1069 Mon Sep 17 00:00:00 2001 From: zhouguangyuan Date: Sun, 1 May 2022 00:11:13 +0800 Subject: [PATCH] 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 Reviewed-by: Keith Randall Auto-Submit: Keith Randall TryBot-Result: Gopher Robot Reviewed-by: Keith Randall Run-TryBot: guangyuan zhou --- src/cmd/compile/internal/reflectdata/reflect.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/cmd/compile/internal/reflectdata/reflect.go b/src/cmd/compile/internal/reflectdata/reflect.go index a9f87baee2b5e..d6e6b115a462a 100644 --- a/src/cmd/compile/internal/reflectdata/reflect.go +++ b/src/cmd/compile/internal/reflectdata/reflect.go @@ -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 }