Closed
Description
This package fails to compile with -d=checkptr
:
package p
import "unsafe"
type P unsafe.Pointer
func f(p P) *int { return (*int)(p) }
func g(p P) P { return P(uintptr(p) + 1) }
This is because the runtime functions have unsafe.Pointer
parameters, but currently when inserting instrumentation, we pass the unsafe pointers as-is (i.e., as P
-typed above, which isn't assignable to unsafe.Pointer
).
Fix is to just add appropriate explicit conversions in the instrumentation.