aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/type.go
diff options
context:
space:
mode:
authorMatthew Dempsky <mdempsky@google.com>2017-08-30 14:17:24 -0700
committerMatthew Dempsky <mdempsky@google.com>2017-09-05 18:09:41 +0000
commitd349fa25dfe2a86c01620f8b049c5e78e46759f3 (patch)
tree966ded630ddf2d7b4df31c367eab6e01c798686e /src/runtime/type.go
parent812b34efaed87584977dd56fbd3b366e13b314f5 (diff)
downloadgo-d349fa25dfe2a86c01620f8b049c5e78e46759f3.tar.gz
go-d349fa25dfe2a86c01620f8b049c5e78e46759f3.zip
cmd/compile: fix and improve struct field reflect information
The previous logic was overly complicated, generated suboptimally encoded struct type descriptors, and mishandled embeddings of predeclared universal types. Fixes #21122. Fixes #21353. Fixes #21696. Fixes #21702. Updates #21357. Change-Id: If34761fa6dbe4af2af59dee501e7f30845320376 Reviewed-on: https://go-review.googlesource.com/60410 Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: David Crawshaw <crawshaw@golang.org>
Diffstat (limited to 'src/runtime/type.go')
-rw-r--r--src/runtime/type.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/runtime/type.go b/src/runtime/type.go
index bf54d54eb4..b3df3353ce 100644
--- a/src/runtime/type.go
+++ b/src/runtime/type.go
@@ -655,15 +655,15 @@ func typesEqual(t, v *_type, seen map[_typePair]struct{}) bool {
if len(st.fields) != len(sv.fields) {
return false
}
+ if st.pkgPath.name() != sv.pkgPath.name() {
+ return false
+ }
for i := range st.fields {
tf := &st.fields[i]
vf := &sv.fields[i]
if tf.name.name() != vf.name.name() {
return false
}
- if tf.name.pkgPath() != vf.name.pkgPath() {
- return false
- }
if !typesEqual(tf.typ, vf.typ, seen) {
return false
}