mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-07 04:23:41 +00:00
compiler: add support for new unsafe slice/string functions
This adds support for unsafe.SliceData, unsafe.String, and unsafe.SringData that were introduced in Go 1.20.
This commit is contained in:
committed by
Ron Evans
parent
33489d6344
commit
c43958972c
@@ -143,10 +143,11 @@ func sliceToArrayPointerPanic() {
|
||||
runtimePanic("slice smaller than array")
|
||||
}
|
||||
|
||||
// Panic when calling unsafe.Slice() (Go 1.17+) with a len that's too large
|
||||
// (which includes if the ptr is nil and len is nonzero).
|
||||
// Panic when calling unsafe.Slice() (Go 1.17+) or unsafe.String() (Go 1.20+)
|
||||
// with a len that's too large (which includes if the ptr is nil and len is
|
||||
// nonzero).
|
||||
func unsafeSlicePanic() {
|
||||
runtimePanic("unsafe.Slice: len out of range")
|
||||
runtimePanic("unsafe.Slice/String: len out of range")
|
||||
}
|
||||
|
||||
// Panic when trying to create a new channel that is too big.
|
||||
|
||||
Reference in New Issue
Block a user