You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The lower index of a Slice is not necessarily 0. If a Slice is created by a subscript operation on Data, like data[52..<data.count], the lower index of the Slice is itself 52. So taking the subscript of that Slice with index 7 is an out-of-bounds access. That’s the crash observed here. Unfortunately, this is confusing because there is no error message displayed.
Attachment: Download
Environment
Reproduced with:
Xcode 11.6 (11E708)
Xcode 12.0 beta 3 (12A8169g)
Command-line Swift version 5.2.4 (swiftlang-1103.0.32.9 clang-1103.0.32.53) Target: x86_64-apple-darwin19.6.0
Command-line Swift version 5.3 (swiftlang-1200.0.22.4 clang-1200.0.25.1) Target: x86_64-apple-darwin19.6.0
Swift Playgrounds 3.3.1 (1167.21.3) on iPadOS 13.6
Additional Detail from JIRA
md5: 1e5fea47d1e68dd76f317e554d2f5a49
Issue Description:
The following application code crashes on the last line when compiled with Swift:
Steps:
Expected:
The code executes without crashing.
Actually:
The code crashes on the last line.
Reported as FB8212804.
The text was updated successfully, but these errors were encountered: