throw("runtime.SetFinalizer: second argument is " + *ftyp._string + ", not a function")
}
ft := (*functype)(unsafe.Pointer(ftyp))
- ins := *(*[]*_type)(unsafe.Pointer(&ft.in))
- if ft.dotdotdot || len(ins) != 1 {
+ if ft.dotdotdot || len(ft.in) != 1 {
throw("runtime.SetFinalizer: cannot pass " + *etyp._string + " to finalizer " + *ftyp._string)
}
- fint := ins[0]
+ fint := ft.in[0]
switch {
case fint == etyp:
// ok - same type
okarg:
// compute size needed for return parameters
nret := uintptr(0)
- for _, t := range *(*[]*_type)(unsafe.Pointer(&ft.out)) {
+ for _, t := range ft.out {
nret = round(nret, uintptr(t.align)) + uintptr(t.size)
}
nret = round(nret, ptrSize)
panic("compileCallback: not a function")
}
ft := (*functype)(unsafe.Pointer(fn._type))
- if ft.out.len != 1 {
+ if len(ft.out) != 1 {
panic("compileCallback: function must have one output parameter")
}
uintptrSize := unsafe.Sizeof(uintptr(0))
- if t := (**_type)(unsafe.Pointer(ft.out.array)); (*t).size != uintptrSize {
+ if ft.out[0].size != uintptrSize {
panic("compileCallback: output parameter size is wrong")
}
argsize := uintptr(0)
- for _, t := range (*[1024](*_type))(unsafe.Pointer(ft.in.array))[:ft.in.len] {
- if (*t).size > uintptrSize {
+ for _, t := range ft.in {
+ if t.size > uintptrSize {
panic("compileCallback: input parameter size is wrong")
}
argsize += uintptrSize