-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Sema: Check availability of key path components [4.2] #17780
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sema: Check availability of key path components [4.2] #17780
Conversation
Fixes <https://bugs.swift.org/browse/SR-7406> / <rdar://problem/39319212>.
@swift-ci Please test |
Build failed |
@shahmishal is this a known issue?
|
@slavapestov I have not seen this failure before. |
@swift-ci Please test macOS |
Build failed |
@shahmishal its non deterministic... |
@slavapestov going to disable this test. (41380265) |
@swift-ci test macOS |
We would crash in these cases: - If all lookup results were subscripts - If all results were unavailable
@swift-ci Please test |
1 similar comment
@swift-ci Please test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks Slava!
Description: We weren't checking availability for keypath components. This could result in runtime crashes if you reference selectors that don't exist yet, or linker errors if you reference private things from an inlinable function body.
Origination: This was an issue ever since keypaths were introduced in Swift 4.0.
Tested: New tests added.
Risk: Pretty low, because the availability checking code itself is well-exercised. The main risk is source compatibility issues, but impacted code was not completely valid in the first place anyway.
Bugs: Fixes https://bugs.swift.org/browse/SR-7406 / rdar://problem/39319212.
Reviewed by: @jckarter