@@ -1447,10 +1447,17 @@ func (e *Entry) ParseType_impl(runtimeVersion string, moduleData *ModuleData, ty
1447
1447
1448
1448
typeAddr := decodePtrSizeBytes (imethoddata [ptrSize * 2 :ptrSize * 3 ], is64bit , littleendian )
1449
1449
parsedTypesIn , _ = e .ParseType_impl (runtimeVersion , moduleData , typeAddr , is64bit , littleendian , parsedTypesIn )
1450
+
1451
+ name_ptr := decodePtrSizeBytes (imethoddata [0 :ptrSize ], is64bit , littleendian )
1452
+ name , err := e .readRTypeName (runtimeVersion , 0 , name_ptr , is64bit , littleendian )
1453
+ if err != nil {
1454
+ continue
1455
+ }
1456
+
1450
1457
methodfunc , found := parsedTypesIn .Get (typeAddr )
1451
1458
if found {
1452
- interfaceDef += " \n method" + strconv . Itoa ( i ) + " " + methodfunc .( Type ). Str
1453
- cinterfaceDef += methodfunc .(Type ).CStr + "method " + strconv . Itoa ( i ) + ";\n "
1459
+ interfaceDef += strings . Replace ( methodfunc .( Type ). Str , "func" , name , 1 ) + "\n "
1460
+ cinterfaceDef += methodfunc .(Type ).CStr + " " + name + ";\n "
1454
1461
}
1455
1462
}
1456
1463
interfaceDef += "\n }"
@@ -1513,7 +1520,7 @@ func (e *Entry) ParseType_impl(runtimeVersion string, moduleData *ModuleData, ty
1513
1520
interfaceDef := "type interface {"
1514
1521
cinterfaceDef := "struct interface {\n "
1515
1522
(* _type ).CStr = "interface_"
1516
- if * & _type .flags & tflagNamed != 0 {
1523
+ if _type .flags & tflagNamed != 0 {
1517
1524
interfaceDef = fmt .Sprintf ("type %s interface {" , _type .Str )
1518
1525
cinterfaceDef = fmt .Sprintf ("struct %s_interface {\n " , _type .CStr )
1519
1526
(* _type ).CStr = fmt .Sprintf ("%s_interface" , _type .CStr )
@@ -1539,10 +1546,16 @@ func (e *Entry) ParseType_impl(runtimeVersion string, moduleData *ModuleData, ty
1539
1546
typeAddr := moduleData .Types + uint64 (method .Typ )
1540
1547
parsedTypesIn , _ = e .ParseType_impl (runtimeVersion , moduleData , typeAddr , is64bit , littleendian , parsedTypesIn )
1541
1548
1549
+ name_ptr := moduleData .Types + uint64 (method .Name )
1550
+ name , err := e .readRTypeName (runtimeVersion , 0 , name_ptr , is64bit , littleendian )
1551
+ if err != nil {
1552
+ continue
1553
+ }
1554
+
1542
1555
methodfunc , found := parsedTypesIn .Get (typeAddr )
1543
1556
if found {
1544
- interfaceDef += " \n method" + strconv . Itoa ( i ) + " " + methodfunc .( Type ). Str
1545
- cinterfaceDef += methodfunc .(Type ).CStr + " method " + strconv . Itoa ( i ) + ";\n "
1557
+ interfaceDef += strings . Replace ( methodfunc .( Type ). Str , "func" , name , 1 ) + "\n "
1558
+ cinterfaceDef += methodfunc .(Type ).CStr + " " + name + ";\n "
1546
1559
}
1547
1560
}
1548
1561
interfaceDef += "\n }"
0 commit comments