Closed
Description
Previous ID | SR-5438 |
Radar | None |
Original Reporter | @johnno1962 |
Type | Bug |
Status | Closed |
Resolution | Done |
Environment
Additional Detail from JIRA
Votes | 0 |
Component/s | Compiler |
Labels | Bug, Android, Runtime |
Assignee | None |
Priority | Medium |
md5: 811dce9ad8c11216c611c20e8ee4b825
relates to:
- SR-5414 ImageInspectionELF.cpp:getSectionInfo crashes on Android
Issue Description:
I’ve been chipping away at getting Swift to work on Android and found that there are problems with the implementation of do/try/catch when swift is run an Android device.
The following example program:
import Foundation
print("Hello, Android")
do {
print("HERE1")
try { throw NSError(domain:"Oh", code:-1) }()
}
catch let err as Error {
print("HERE2")
}
print("DONE")
Produces this output on Linux/macOS:
Hello, Android
HERE1
HERE2
DONE
Whereas on Android following the instructions from https://github.com/apple/swift/blob/master/docs/Android.md
produces the following output:
Hello, Android
HERE1
DONE
This is causing crashes in corefoundation where errors should have been trapped and code goes down the wrong path as a result. This is from a version of Swift from master about a month ago. I’ll be building from a more up to date version soon and will close this report if this is resolved.