[SR-7426] Segmentation fault when building with -Osize #49969
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
compiler
The Swift compiler itself
crash
Bug: A crash, i.e., an abnormal termination of software
optimized only
Flag: An issue whose reproduction requires optimized compilation
Environment
Xcode 9.3, Swift 4.1
Swift 4.2 master (5ea4848)
Additional Detail from JIRA
md5: 9dfe97cde2c14b3c4990b74e565d74af
Issue Description:
Compiling the code below with -Osize should trigger a segfault (or assertion failure). It can be worked around by forcing the type of "resource" to be Optional.
I tried to dig in to the code for this. As far as I could see the error occurs in the Outliner pass in -Osize, where ti's is creating an outline for the Obj-C method call for bundle.path(forResource:ofType🙂. Both of its parameters take Optional<String> (or Optional<NSString>) but it generates a non-optional String parameter type and it causes a type mismatch.
The text was updated successfully, but these errors were encountered: