gitlab.com/Raven-IO/raven-delve@v1.22.4/_fixtures/testunsafepointers.go (about)

     1  package main
     2  
     3  import (
     4  	"runtime"
     5  	"unsafe"
     6  )
     7  
     8  func main() {
     9  	// We're going to produce a pointer with a bad address.
    10  	badAddr := uintptr(0x42)
    11  	unsafeDanglingPtrPtr := unsafe.Pointer(badAddr)
    12  	// We produce a **int, instead of more simply a *int, in order for the test
    13  	// program to test more complex Delve behavior.
    14  	danglingPtrPtr := (**int)(unsafeDanglingPtrPtr)
    15  	_ = danglingPtrPtr
    16  	runtime.Breakpoint()
    17  }