goplus/igop

unsafe.Slice for go1.18

visualfc opened this issue · 0 comments

$GOROOT/test/unsafebuiltins.go

// sliced memory overflows address space
last := (*byte)(unsafe.Pointer(^uintptr(0)))
_ = unsafe.Slice(last, 1)
mustPanic(func() { _ = unsafe.Slice(last, 2) })