runtime: fix reflect type for go1.23

This commit is contained in:
visualfc
2025-01-29 18:34:22 +08:00
parent 0b1c4fb54f
commit edd561f8ba
6 changed files with 603 additions and 199 deletions

View File

@@ -207,6 +207,7 @@ func Struct(pkgPath string, size uintptr, fields ...abi.StructField) *Type {
if len(fields) == 2 && fields[0].Name_ == "$f" && fields[0].Typ.Kind() == abi.Func &&
fields[1].Name_ == "$data" && fields[1].Typ.Kind() == abi.UnsafePointer {
ret.TFlag |= abi.TFlagClosure
ret.Str_ = funcStr(fields[0].Typ.FuncType())
}
rtypeList.addType(&ret.Type)
return &ret.Type