Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
AsterDY committed May 27, 2024
1 parent d447e3a commit b47a0f0
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 18 deletions.
19 changes: 17 additions & 2 deletions internal/rt/assertI2I.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,21 @@ import (
_ `unsafe`
)

//go:linkname AssertI2I runtime.assertI2I2
func AssertI2I(inter *GoType, i GoIface) GoIface
func AssertI2I(t *GoType, i GoIface) (r GoIface) {
inter := IfaceType(t)
tab := i.Itab
if tab == nil {
return
}
if (*GoInterfaceType)(tab.it) != inter {
tab = GetItab(inter, tab.Vt, true)
if tab == nil {
return
}
}
r.Itab = tab
r.Value = i.Value
return
}


16 changes: 0 additions & 16 deletions internal/rt/fastvalue.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,21 +232,5 @@ func (t *GoType) IsUint32() bool {
//go:linkname GetItab runtime.getitab
func GetItab(inter *GoInterfaceType, typ *GoType, canfail bool) *GoItab

func AssertI2I2(t *GoType, i GoIface) (r GoIface) {
inter := IfaceType(t)
tab := i.Itab
if tab == nil {
return
}
if (*GoInterfaceType)(tab.it) != inter {
tab = GetItab(inter, tab.Vt, true)
if tab == nil {
return
}
}
r.Itab = tab
r.Value = i.Value
return
}


0 comments on commit b47a0f0

Please sign in to comment.