mirror of
https://github.com/golang/go
synced 2024-11-23 06:50:05 -07:00
reflect: fix stack overflow panic when using haveIdenticalUnderlyingType
This commit is contained in:
parent
163de19b47
commit
4d4217f0c1
@ -1599,7 +1599,7 @@ func haveIdenticalType(T, V Type, cmpTags bool) bool {
|
|||||||
return T == V
|
return T == V
|
||||||
}
|
}
|
||||||
|
|
||||||
if T.Name() != V.Name() || T.Kind() != V.Kind() {
|
if T.Name() != V.Name() || T.Kind() != V.Kind() || T.PkgPath() != V.PkgPath() {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1679,9 +1679,6 @@ func haveIdenticalUnderlyingType(T, V *rtype, cmpTags bool) bool {
|
|||||||
if tf.name.name() != vf.name.name() {
|
if tf.name.name() != vf.name.name() {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
if tf.typ.Kind() != Struct && tf.typ.str != vf.typ.str {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
if !haveIdenticalType(tf.typ, vf.typ, cmpTags) {
|
if !haveIdenticalType(tf.typ, vf.typ, cmpTags) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user