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
{{ message }}
This repository has been archived by the owner on Jan 26, 2025. It is now read-only.
Summary:
When using a closed range in a switch case, and then end of the range is the maximum value for the variable type (e.g.: 0xFF for UInt8, 0xFFFF for UIn16, etc...), the application will crash at runtime when reaching the switch
Steps to Reproduce:
Sample code
let a: UInt8 = 0 // Any number here, doesn't matter
switch a {
case 0xF0...0xFF: // Any start value, doesn't matter
println("a")
default:
break
}
Expected Results:
Switch is executed correctly
Actual Results:
Console output:
fatal error: Range end index has no valid successor
Exception stack:
thread 22108400: Swift 2.0b4: Allow if let and guard let to assign to self in failable value type initializers #1: tid = 0x29ac1, 0x000000010589e0de libswiftCore.dylib`function signature specialization <Arg[0] = Exploded, Arg[1] = Exploded, Arg[2] = Dead, Arg[3] = Dead> of Swift._fatalErrorMessage (Swift.StaticString, Swift.StaticString, Swift.StaticString, Swift.UInt) -> () + 158, queue = 'com.apple.main-thread', stop reason = EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0)
Description
Summary:
When using a closed range in a switch case, and then end of the range is the maximum value for the variable type (e.g.: 0xFF for UInt8, 0xFFFF for UIn16, etc...), the application will crash at runtime when reaching the switch
Steps to Reproduce:
Sample code
let a: UInt8 = 0 // Any number here, doesn't matter
switch a {
case 0xF0...0xFF: // Any start value, doesn't matter
println("a")
default:
break
}
Expected Results:
Switch is executed correctly
Actual Results:
Console output:
fatal error: Range end index has no valid successor
Exception stack:
if let
andguard let
to assign toself
in failable value type initializers #1: tid = 0x29ac1, 0x000000010589e0de libswiftCore.dylib`function signature specialization <Arg[0] = Exploded, Arg[1] = Exploded, Arg[2] = Dead, Arg[3] = Dead> of Swift._fatalErrorMessage (Swift.StaticString, Swift.StaticString, Swift.StaticString, Swift.UInt) -> () + 158, queue = 'com.apple.main-thread', stop reason = EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0)function signature specialization <Arg[0] = Exploded, Arg[1] = Exploded, Arg[2] = Dead, Arg[3] = Dead> of Swift._fatalErrorMessage (Swift.StaticString, Swift.StaticString, Swift.StaticString, Swift.UInt) -> () + 158 frame #1: 0x0000000105dfc4d3 $__lldb_expr332
main + 1235 at playground332.swift:9frame 22108390: Swift 2.0b4: Allow assignment of nil to self in failable initializers to indicate failure #2: 0x0000000105673230 MyPlayground
_mh_execute_header + 25136 frame #3: 0x00000001056757f1 MyPlayground
reabstraction thunk helper from @callee_owned () -> (@unowned ()) to @callee_owned (@in ()) -> (@out ()) + 17frame 22108127: Apple Music: CarPlay does not show the For You Playlists #4: 0x0000000105674a51 MyPlayground
partial apply forwarder for reabstraction thunk helper from @callee_owned () -> (@unowned ()) to @callee_owned (@in ()) -> (@out ()) + 81 frame #5: 0x0000000105675870 MyPlayground
reabstraction thunk helper from @callee_owned (@in ()) -> (@out ()) to @callee_owned () -> (@unowned ()) + 32frame 22108095: Changing account in Music app requires force-quit #6: 0x00000001056758a7 MyPlayground
reabstraction thunk helper from @callee_owned () -> (@unowned ()) to @callee_unowned @objc_block () -> (@unowned ()) + 39 frame #7: 0x00007fff8d5992ac CoreFoundation
CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK + 12frame 22107434: Providing Generic Generator for protocol intermittently crashes compiler #8: 0x00007fff8d58b3b5 CoreFoundation
__CFRunLoopDoBlocks + 341 frame #9: 0x00007fff8d58ab6e CoreFoundation
__CFRunLoopRun + 910frame 22107245: Xcode 7 beta 4 (7A165t) Interface Builder ignores background color set on UITableView #10: 0x00007fff8d58a598 CoreFoundation
CFRunLoopRunSpecific + 296 frame #11: 0x00007fff90b2cc4f HIToolbox
RunCurrentEventLoopInMode + 235frame 22106516: watchOS 2 Beta 4: Can’t Import CoreText #12: 0x00007fff90b2c8ce HIToolbox
ReceiveNextEventCommon + 179 frame #13: 0x00007fff90b2c80b HIToolbox
_BlockUntilNextEventMatchingListInModeWithFilter + 71frame 22105625: Mac OS X 10.11: Battery status alwasy shows "20:00 Remaining" #14: 0x00007fff8c776a91 AppKit
_DPSNextEvent + 964 frame #15: 0x00007fff8c776090 AppKit
-[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 194frame 22103992: Stack implemented with enum causes Abort trap: 6 #16: 0x00007fff8c76bd93 AppKit
-[NSApplication run] + 594 frame #17: 0x00000001056735a5 MyPlayground
main + 885frame 22103156: News app interface sometimes not visible or incorrect #18: 0x00007fff8e5da5c9 libdyld.dylib`start + 1
Product Version: Xcode 6.3 beta1 (6D520o) / Swift 1.2
Created: 2015-02-10T12:07:15.930499
Originated: 2015-10-02T00:00:00
Open Radar Link: http://www.openradar.me/19779978
The text was updated successfully, but these errors were encountered: