ssa: MakeInterface check abi.KindDirectIface
This commit is contained in:
@@ -132,7 +132,7 @@ func doInitNamed(ret *Type, pkgPath, name string, underlying *Type, methods []Me
|
||||
panic("runtime: underlying type is already named")
|
||||
}
|
||||
|
||||
kind := abi.Kind(ret.Kind_)
|
||||
kind := ret.Kind()
|
||||
if ret.TFlag != abi.TFlagUninited || kind != underlying.Kind() {
|
||||
panic("initNamed: unexpected named type")
|
||||
}
|
||||
@@ -246,4 +246,11 @@ func methods(u *abi.UncommonType, from string) []abi.Method {
|
||||
return u.ExportedMethods()
|
||||
}
|
||||
|
||||
func IfaceData(i iface) unsafe.Pointer {
|
||||
if i.tab._type.Kind_&abi.KindDirectIface != 0 {
|
||||
return unsafe.Pointer(&i.data)
|
||||
}
|
||||
return i.data
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user