aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/reflectdata/reflect.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmd/compile/internal/reflectdata/reflect.go')
-rw-r--r--src/cmd/compile/internal/reflectdata/reflect.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/cmd/compile/internal/reflectdata/reflect.go b/src/cmd/compile/internal/reflectdata/reflect.go
index 19cf2a0a12..a8df7a1a24 100644
--- a/src/cmd/compile/internal/reflectdata/reflect.go
+++ b/src/cmd/compile/internal/reflectdata/reflect.go
@@ -947,7 +947,7 @@ func writeType(t *types.Type) *obj.LSym {
}
dupok := 0
- if tbase.Sym() == nil { // TODO(mdempsky): Probably need DUPOK for instantiated types too.
+ if tbase.Sym() == nil || tbase.HasShape() { // TODO(mdempsky): Probably need DUPOK for instantiated types too.
dupok = obj.DUPOK
}
@@ -1738,6 +1738,11 @@ func NeedEmit(typ *types.Type) bool {
// Need to emit to be safe (however, see TODO above).
return true
+ case typ.HasShape():
+ // Shape type; need to emit even though it lives in the .shape package.
+ // TODO: make sure the linker deduplicates them (see dupok in writeType above).
+ return true
+
default:
// Should have been emitted by an imported package.
return false