mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-05 03:27:48 +00:00
compiler: fix make([]T, ...) with big integers on 32-bit systems or less
Previously, this would have resulted in a LLVM verification error because runtime.sliceBoundsCheckMake would not accept 64-bit integers on these platforms.
This commit is contained in:
committed by
Ron Evans
parent
28987ae061
commit
8e99c3313b
@@ -62,3 +62,10 @@ func sliceBoundsCheckMake(length, capacity uint) {
|
||||
runtimePanic("slice size out of range")
|
||||
}
|
||||
}
|
||||
|
||||
// Check for bounds in *ssa.MakeSlice. Supports 64-bit indexes.
|
||||
func sliceBoundsCheckMake64(length, capacity uint64) {
|
||||
if !(0 <= length && length <= capacity) {
|
||||
runtimePanic("slice size out of range")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user