Uploaded image for project: 'Swift'
  1. Swift
  2. SR-2988

CharacterSet.insert(charactersIn: ClosedRange) crashes on a closed ClosedRange<UnicodeScalar> containing U+D7FF

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Medium
    • Resolution: Done
    • Component/s: Compiler, Foundation
    • Labels:
    • Environment:

      Verified on both:

      macOS 10.12: Apple Swift version 3.0 (swiftlang-800.0.46.2 clang-800.0.38), Target: x86_64-apple-macosx10.9
      Ubuntu 15.10: Swift version 3.0 (swift-3.0-RELEASE), Target: x86_64-unknown-linux-gnu

      Description

      Attempting to insert U+D7FF into a CharacterSet crashes when that UnicodeScalar is contained in a ClosedRange<UnicodeScalar>. A crash also occurs when trying to construct a CharacterSet directly with init(charactersIn: ClosedRange<UnicodeScalar>). No such crash occurs when initializing or inserting into a CharacterSet with that single UnicodeScalar.

      On macOS, the crash results in: EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0)
      On linux, the crash results in: signal SIGILL: illegal instruction operand

        Attachments

          Activity

            People

            • Assignee:
              jaspa Janek Spaderna
              Reporter:
              kasei Gregory Williams
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: