summaryrefslogtreecommitdiff
path: root/vendor/github.com/bytedance/sonic/internal/rt/fastvalue.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/bytedance/sonic/internal/rt/fastvalue.go')
-rw-r--r--vendor/github.com/bytedance/sonic/internal/rt/fastvalue.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/vendor/github.com/bytedance/sonic/internal/rt/fastvalue.go b/vendor/github.com/bytedance/sonic/internal/rt/fastvalue.go
index befaeb715..6657220ab 100644
--- a/vendor/github.com/bytedance/sonic/internal/rt/fastvalue.go
+++ b/vendor/github.com/bytedance/sonic/internal/rt/fastvalue.go
@@ -232,3 +232,12 @@ func AssertI2I2(t *GoType, i GoIface) (r GoIface) {
//go:noescape
//go:linkname Getitab runtime.getitab
func Getitab(inter *GoInterfaceType, typ *GoType, canfail bool) *GoItab
+
+
+func GetFuncPC(fn interface{}) uintptr {
+ ft := UnpackEface(fn)
+ if ft.Type.Kind() != reflect.Func {
+ panic("not a function")
+ }
+ return *(*uintptr)(ft.Value)
+} \ No newline at end of file