[stdlib] Adding bounds check in a.subscript(Index) fast path

UnsafeBufferPoiunter subscript used in the fast path only checks bounds
in Debug mode, therefore extra checks are needed.

Addresses: <rdar://problem/31992473>
This commit is contained in:
Max Moiseev
2017-05-05 13:09:53 -07:00
committed by Maxim Moiseev
parent 5baa080edb
commit 178b9f0b44
2 changed files with 9 additions and 4 deletions

View File

@@ -192,9 +192,7 @@ StringTests.test("ForeignIndexes/UnexpectedCrash")
expectEqual("a", acceptor[donor.startIndex])
}
StringTests.test("ForeignIndexes/subscript(Index)/OutOfBoundsTrap")
.skip(.always("<rdar://problem/31992473>"))
.code {
StringTests.test("ForeignIndexes/subscript(Index)/OutOfBoundsTrap") {
let donor = "abcdef"
let acceptor = "uvw"