@@ -2059,12 +2059,12 @@ func isFixedLoad(v *Value, sym Sym, off int64) bool {
2059
2059
return false
2060
2060
}
2061
2061
2062
- if strings . HasPrefix ( lsym . Name , "type:" ) {
2062
+ if ti := lsym . TypeInfo (); ti != nil {
2063
2063
// Type symbols do not contain information about their fields, unlike the cases above.
2064
2064
// Hand-implement field accesses.
2065
2065
// TODO: can this be replaced with reflectdata.writeType and just use the code above?
2066
2066
2067
- t := ( * lsym . Extra ).( * obj. TypeInfo ) .Type .(* types.Type )
2067
+ t := ti .Type .(* types.Type )
2068
2068
2069
2069
for _ , f := range rttype .Type .Fields () {
2070
2070
if f .Offset == off && copyCompatibleType (v .Type , f .Type ) {
@@ -2118,12 +2118,12 @@ func rewriteFixedLoad(v *Value, sym Sym, sb *Value, off int64) *Value {
2118
2118
base .Fatalf ("fixedLoad data not known for %s:%d" , sym , off )
2119
2119
}
2120
2120
2121
- if strings . HasPrefix ( lsym . Name , "type:" ) {
2121
+ if ti := lsym . TypeInfo (); ti != nil {
2122
2122
// Type symbols do not contain information about their fields, unlike the cases above.
2123
2123
// Hand-implement field accesses.
2124
2124
// TODO: can this be replaced with reflectdata.writeType and just use the code above?
2125
2125
2126
- t := ( * lsym . Extra ).( * obj. TypeInfo ) .Type .(* types.Type )
2126
+ t := ti .Type .(* types.Type )
2127
2127
2128
2128
ptrSizedOpConst := OpConst64
2129
2129
if f .Config .PtrSize == 4 {
@@ -2613,10 +2613,7 @@ func isDirectType1(v *Value) bool {
2613
2613
return isDirectType2 (v .Args [0 ])
2614
2614
case OpAddr :
2615
2615
lsym := v .Aux .(* obj.LSym )
2616
- if lsym .Extra == nil {
2617
- return false
2618
- }
2619
- if ti , ok := (* lsym .Extra ).(* obj.TypeInfo ); ok {
2616
+ if ti := lsym .TypeInfo (); ti != nil {
2620
2617
return types .IsDirectIface (ti .Type .(* types.Type ))
2621
2618
}
2622
2619
}
@@ -2649,10 +2646,7 @@ func isDirectIface1(v *Value, depth int) bool {
2649
2646
return isDirectIface2 (v .Args [0 ], depth - 1 )
2650
2647
case OpAddr :
2651
2648
lsym := v .Aux .(* obj.LSym )
2652
- if lsym .Extra == nil {
2653
- return false
2654
- }
2655
- if ii , ok := (* lsym .Extra ).(* obj.ItabInfo ); ok {
2649
+ if ii := lsym .ItabInfo (); ii != nil {
2656
2650
return types .IsDirectIface (ii .Type .(* types.Type ))
2657
2651
}
2658
2652
case OpConstNil :
0 commit comments