[SR-7621] Compiler segfault when capturing weak object #50163
Labels
accepts invalid
Bug: Accepts invalid
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
compiler
The Swift compiler in itself
crash
Bug: A crash, i.e., an abnormal termination of software
type checker
Area → compiler: Semantic analysis
Attachment: Download
Environment
Swift 4.1 – Xcode 9.3 (9E145)
Additional Detail from JIRA
md5: 0fff273ce8c21a137a47b9c372a58939
duplicates:
Issue Description:
Code to reproduce:
This is reproducible from both Xcode and `swift` command line. See the attachment for more examples.
Some observations:
The crash is in SILGen so the code must be valid Swift to hit the issue
Strong capture of the object in the inner closure is fine.
Compiler is fine if the object being captured is global, crash happens only if it’s an argument.
To make sure this is not a duplicate, tried the snippet from the following bugs in the same version of compiler, none of them caused a segfault:
SR-5408SR-5413SR-5867The text was updated successfully, but these errors were encountered: