Skip to content

[4.2] Start recovering from missing types in SIL deserialization #17591

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

Conversation

jrose-apple
Copy link
Contributor

@jrose-apple jrose-apple commented Jun 28, 2018

  • Explanation: When mixing Swift language versions, entities from Objective-C can import very differently, or even vanish entirely. (Consider a library that uses an NS_TYPED_ENUM type in Swift 4.2, but then an app built with 4.0 comes along and sees the type as a plain typedef. The unique struct type is gone.) This affects both AST declarations and SIL entities, including functions that appear in a SIL witness table. This change adds a simple check for not being able to decode the type of the function; if that is the case, the entire function is ignored, as if it were dropped from the module.

  • Scope: Changes the code used to deserialize all SILFunctions, but shouldn't actually change the happy-path behavior, only cases that would have crashed.

  • Issue: rdar://problem/40899824

  • Risk: Medium-low. This only changes the behavior of code the compiler would have crashed on, but if there are problems later on because of the recovery they'll be a little harder to track down.

  • Testing: Passed existing compiler regression tests, verified that original (reduced) project builds successfully.

  • Reviewed by: @slavapestov

…ly-idea

Start recovering from missing types in SIL deserialization

rdar://problem/40899824
(cherry picked from commit 747e318)
@jrose-apple
Copy link
Contributor Author

@swift-ci Please test

@jrose-apple
Copy link
Contributor Author

@swift-ci Please nominate

@jrose-apple jrose-apple merged commit ff66b79 into swiftlang:swift-4.2-branch Jun 28, 2018
@jrose-apple jrose-apple deleted the 4.2-recovery-is-a-SILly-idea branch June 28, 2018 18:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant