github.com/moontrade/wavm-go@v0.3.2-0.20220316110326-d229dd66ad65/worker/cgo_fuzzer.go (about) 1 //go:build libfuzzer 2 // +build libfuzzer 3 4 package worker 5 6 // #include "worker.h" 7 import "C" 8 import "unsafe" 9 10 //go:linkname libfuzzerCall runtime.libfuzzerCall 11 func libfuzzerCall(fn *byte, arg0, arg1 uintptr) 12 13 func callStub() { 14 libfuzzerCall((*byte)(C.moontrade_stub), 0, 0) 15 } 16 17 func (w *Worker) doCall() { 18 libfuzzerCall((*byte)(C.moontrade_call), uintptr(unsafe.Pointer(&w.Args)), 0) 19 } 20 21 func now() { 22 libfuzzerCall((*byte)(C.moontrade_now), 0, 0) 23 }