-
Notifications
You must be signed in to change notification settings - Fork 10.6k
[4.0] Serialization: Create a deserialized EnumDecl before deserializing its dependency types. #9875
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
[4.0] Serialization: Create a deserialized EnumDecl before deserializing its dependency types. #9875
Conversation
|
@swift-ci Please test |
|
@swift-ci Please test source compatibility |
|
@jrose-apple Does this look OK for the 4.0 branch? |
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.
Unfortunately this is exactly the situation we're trying to prevent. Once a type has been stored in declOrOffset, it might be referenced by other parts of the code, which would be a problem if it turns out to have an error in it.
|
How can we avoid this problem, then? |
|
Hm. Since merge-modules happens on swiftmodules that we just built (or that didn't need rebuilding), we could just skip dependency checking altogether in that phase. We won't have cycles in any other situations. |
|
Build failed |
|
Build failed |
…an enum. There can be a circularity when two enums recur through each other, and deserialization currently is not set up to robustly detect and avoid these circularities. This should avoid regressions, but re-exposes some possible cases that should require recovery in mix-and-match situations. Short-term fix for rdar://problem/32337278.
b0dbf54 to
a7bd12d
Compare
|
@swift-ci Please test |
|
@swift-ci Please test source compatibility |
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.
New version looks good for 4.0!
|
@swift-ci Please test |
|
@swift-ci Please test source compatibility |
Explanation: Breaks a circularity that can occur when two enums recur through each other.
Scope: Deserialization crash when two enums reference each other from different separately-compiled files that get merged together into one module.
Issue: rdar://problem/32337278
Risk: Low, small bug fix
Testing: Swift CI, project from Radar, source compatibility suite