-
Notifications
You must be signed in to change notification settings - Fork 10.5k
IRGen: Fix multi-payload enum lowering #17484
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
IRGen: Fix multi-payload enum lowering #17484
Conversation
When we have a private resilient enum that is resilient because one of its payloads is resilient but we have disabled resilience in the context of lowering the enum as a class member (sigh), we must consider it's payload's layout enum in the minimal domain (ignore the private visibility) because we don't truly know the layout. rdar://41308521
@swift-ci Please test |
Build failed |
lib/IRGen/GenEnum.cpp
Outdated
// If we forced completely fragile layout we need to check the | ||
// fixed-sized'ness in the minimal scope. Otherwise, we get wrong answer for | ||
// private resilient enum types that have an resilient payload. | ||
layoutScope = ResilienceExpansion::Minimal; |
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.
Perhaps this should be part of TC.IGM.getResilienceExpansionForLayout()? Are there other places where we call it and get it wrong?
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.
I sunk the logic.
Build failed |
This clearly satisfies the postcondition that 'Calling isResilient() with this scope will always return false.'
@swift-ci Please test |
Build failed |
Build failed |
@swift-ci Please test |
Build failed |
Build failed |
@swift-ci Please test |
Build failed |
Build failed |
Oh, right this test case is not going to work on linux where we don't have to expand resilient types in classes because of objc interrupt ... |
@swift-ci Please test |
Build failed |
Build failed |
@swift-ci Please test |
Build failed |
Build failed |
When we have a private resilient enum that is resilient because one of
its payloads is resilient but we have disabled resilience in the
context of lowering the enum as a class member (sigh), we must consider
it's payload's layout enum in the minimal domain (ignore the private
visibility) because we don't truly know the layout.
rdar://41308521