goplus / igop

The Go/Go+ Interpreter

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

unsafe.Slice for go1.18

visualfc opened this issue · 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) })