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.
Reported by Asif Jalil on golang-dev.
This package fails to compile with
-d=checkptr:This is because the runtime functions have
unsafe.Pointerparameters, but currently when inserting instrumentation, we pass the unsafe pointers as-is (i.e., asP-typed above, which isn't assignable tounsafe.Pointer).Fix is to just add appropriate explicit conversions in the instrumentation.
Reported by Asif Jalil on golang-dev.