github.com/moontrade/nogc@v0.1.7/unsafecgo/call_libfuzzer.go (about)

     1  //go:build libfuzzer && (amd64 || arm64)
     2  // +build libfuzzer
     3  // +build amd64 arm64
     4  
     5  package unsafecgo
     6  
     7  import (
     8  	"github.com/moontrade/wavm-go/unsafecgo/cgo"
     9  	_ "unsafe"
    10  )
    11  
    12  // NonBlocking C function fn without going all the way through cgo.
    13  // Example: NonBlocking((*byte)(C.my_c_func), 0, 0)
    14  // 			void my_c_func(size_t arg0, size_t arg1) {
    15  //			}
    16  //go:noescape
    17  //go:nosplit
    18  //go:linkname NonBlocking runtime.libfuzzerCall
    19  func NonBlocking(fn *byte, arg0, arg1 uintptr)
    20  
    21  func Blocking(fn *byte, arg0, arg1 uintptr) {
    22  	cgo.Blocking(fn, arg0, arg1)
    23  }