mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-18 03:24:00 +00:00
compiler: emit a nil check when slicing an array pointer
This commit is contained in:
@@ -1852,6 +1852,7 @@ func (b *builder) createExpr(expr ssa.Value) (llvm.Value, error) {
|
|||||||
low,
|
low,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
b.createNilCheck(expr.X, value, "slice")
|
||||||
b.createSliceBoundsCheck(llvmLen, low, high, max, lowType, highType, maxType)
|
b.createSliceBoundsCheck(llvmLen, low, high, max, lowType, highType, maxType)
|
||||||
|
|
||||||
// Truncate ints bigger than uintptr. This is after the bounds
|
// Truncate ints bigger than uintptr. This is after the bounds
|
||||||
|
|||||||
Reference in New Issue
Block a user