[stdlib] Add missing precondition check

Fixes <rdar://problem/17392712> UnsafeArray.init() should _precondition(length >= 0)

Swift SVN r19373
This commit is contained in:
Dave Abrahams
2014-06-30 21:59:42 +00:00
parent c04aae5dce
commit c703a76cdc

View File

@@ -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
}