We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Attachment: Download
xcodebuild -version Xcode 8.2 Build version 8C38
swift --version Apple Swift version 3.0.2 (swiftlang-800.0.63 clang-800.0.42.1) Target: x86_64-apple-macosx10.9
md5: b6a77aabb80a8d86278845247ab9a265
Issue Description:
The following code causes a crash in foundation at runtime:
var set = CharacterSet() set.insert("\u{D7FF}") // no crash set.insert("\u{D7FF}") // no crash set.insert(charactersIn: "\u{D7FE}"..."\u{D7FF}") // crashes
According to the UnicodeScalar.init(_:UInt32) source, 0xD7FF is a valid character:
UnicodeScalar.init(_:UInt32)
0xD7FF
// * As a result of this definition, the set of Unicode scalar values // consists of the ranges 0 to D7FF and E000 to 10FFFF, inclusive.
https://github.com/apple/swift/blob/2fe4254cb712fa101a220f95b6ade8f99f43dc74/stdlib/public/core/UnicodeScalar.swift#L97
I suspect there is an edge case where 0xD7FF is accidentally excluded.
The text was updated successfully, but these errors were encountered:
Interestingly, in the Xcode 9.4.1 toolchain on a Mac, the behavior is reversed:
var set = CharacterSet() set.insert(charactersIn: "\u{D7FE}"..."\u{D7FF}") // no crash set.insert("\u{D7FF}") // crashes
Sorry, something went wrong.
This now works without crashing, tested on swift 5.1 (Xcode 11.3.1) and swift-5.1.3 on Ubuntu18
No branches or pull requests
Attachment: Download
Environment
xcodebuild -version Xcode 8.2 Build version 8C38
swift --version Apple Swift version 3.0.2 (swiftlang-800.0.63 clang-800.0.42.1) Target: x86_64-apple-macosx10.9
Additional Detail from JIRA
md5: b6a77aabb80a8d86278845247ab9a265
Issue Description:
The following code causes a crash in foundation at runtime:
According to the
UnicodeScalar.init(_:UInt32)
source,0xD7FF
is a valid character:https://github.com/apple/swift/blob/2fe4254cb712fa101a220f95b6ade8f99f43dc74/stdlib/public/core/UnicodeScalar.swift#L97
I suspect there is an edge case where
0xD7FF
is accidentally excluded.The text was updated successfully, but these errors were encountered: