mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[stdlib] Add missing precondition check
Fixes <rdar://problem/17392712> UnsafeArray.init() should _precondition(length >= 0) Swift SVN r19373
This commit is contained in:
@@ -57,6 +57,7 @@
|
||||
}
|
||||
|
||||
@public init(start: UnsafePointer<T>, length: Int) {
|
||||
_precondition(length >= 0, "Unsafe${Mutable}Array with negative length")
|
||||
_position = start
|
||||
_end = start + length
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user