compiler: emit a nil check when slicing an array pointer

This commit is contained in:
Nia Weiss
2021-01-15 15:03:05 -05:00
committed by Ayke
parent a848d720db
commit f159429152
+1
View File
@@ -1852,6 +1852,7 @@ func (b *builder) createExpr(expr ssa.Value) (llvm.Value, error) {
low,
}
b.createNilCheck(expr.X, value, "slice")
b.createSliceBoundsCheck(llvmLen, low, high, max, lowType, highType, maxType)
// Truncate ints bigger than uintptr. This is after the bounds