-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Closed
Closed
Copy link
Labels
bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler itselfThe Swift compiler itselfcrashBug: A crash, i.e., an abnormal termination of softwareBug: A crash, i.e., an abnormal termination of softwarerun-time crashBug → crash: Swift code crashed during executionBug → crash: Swift code crashed during execution
Description
Previous ID | SR-3132 |
Radar | rdar://problem/34992686 |
Original Reporter | plivesey (JIRA User) |
Type | Bug |
Status | Resolved |
Resolution | Done |
Additional Detail from JIRA
Votes | 1 |
Component/s | Compiler |
Labels | Bug, RunTimeCrash |
Assignee | @slavapestov |
Priority | Medium |
md5: e5a714538eff95d9400fe430806b9c2a
Issue Description:
Run the following code (sometimes works in a playground):
class X {
public init?(error: (String) throws ->Void) rethrows {
try error("dictionary is not valid!")
return nil
}
public convenience init() throws {
try self.init() { _ in
throw NSError(domain: "", code: 0, userInfo: nil)
}!
}
}
do {
let x = try X()
} catch {
print("hi")
}
Expected: Either this should not compile, or it should EXC_BAD_ACCESS because of the ! (even though I feel like it should throw out of there? maybe not...as I said, the code is weird).
Actual:
malloc: *** error for object 0x6080000174ac: Invalid pointer dequeued from free list
- - - set a breakpoint in malloc_error_break to debug
Metadata
Metadata
Assignees
Labels
bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler itselfThe Swift compiler itselfcrashBug: A crash, i.e., an abnormal termination of softwareBug: A crash, i.e., an abnormal termination of softwarerun-time crashBug → crash: Swift code crashed during executionBug → crash: Swift code crashed during execution