Skip to content

Commit

Permalink
cmd/compile: mark shape type dupok
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
zhouguangyuan0718 authored and gopherbot committed May 3, 2022
1 parent 5a103ca commit 884530b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/cmd/compile/internal/reflectdata/reflect.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit 884530b

Please sign in to comment.