An invalid pointer triggers a runtime failure when passed as argument in
Go1.7: runtime: bad pointer in frame github.com/kylelemons/gousb/usb.(*fakeLibusb).open at 0xc420045ce0: 0x1 fatal error: invalid stack pointer Use an arbitrary C-allocated pointer instead.
This commit is contained in:
@@ -421,7 +421,11 @@ func xfer_callback(cptr unsafe.Pointer) {
|
||||
close(ch)
|
||||
}
|
||||
|
||||
// for benchmarking
|
||||
// for benchmarking and testing
|
||||
func libusbSetDebug(c *libusbContext, lvl int) {
|
||||
C.libusb_set_debug((*C.libusb_context)(c), C.int(lvl))
|
||||
}
|
||||
|
||||
func newCPointer() unsafe.Pointer {
|
||||
return unsafe.Pointer(C.malloc(1))
|
||||
}
|
||||
|
Reference in New Issue
Block a user