Skip to content

[5.0] IRGen: Fix extra inhabitants of multi-payload enums with more spare bits than tag bits. #21068

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

jckarter
Copy link
Contributor

@jckarter jckarter commented Dec 5, 2018

Because layout minimizes the number of tag bits used, and favors high spare bits, the
spare bit representations end up overlapping the extra inhabitant representations, since we
just counted down from -1. If there are fewer tag bits than total spare bits, rotate the
extra inhabitant values so they correctly line up with the tag representations in this
situation. rdar://problem/46468090

This is ABI-impacting (though it shouldn't impact any standard library or overlay types, otherwise we would've noticed this) and necessary for convergence (since it blocks Foundation work).

@jckarter jckarter requested a review from a team as a code owner December 5, 2018 23:15
@jckarter
Copy link
Contributor Author

jckarter commented Dec 5, 2018

@swift-ci Please test

@swift-ci
Copy link
Contributor

swift-ci commented Dec 6, 2018

Build failed
Swift Test Linux Platform
Git Sha - fabecbf3778cac6cd714d5ef6d3a6371d93aa2f4

…its than tag bits.

Because layout minimizes the number of tag bits used, and favors high spare bits, the
spare bit representations end up overlapping the extra inhabitant representations, since we
just counted down from -1. If there are fewer tag bits than total spare bits, rotate the
extra inhabitant values so they correctly line up with the tag representations in this
situation. rdar://problem/46468090
@jckarter jckarter force-pushed the multi-payload-extra-inhabitant-bit-order-5.0 branch from fabecbf to 85ae390 Compare December 6, 2018 21:02
@jckarter
Copy link
Contributor Author

jckarter commented Dec 6, 2018

@swift-ci Please test

@swift-ci
Copy link
Contributor

swift-ci commented Dec 6, 2018

Build failed
Swift Test OS X Platform
Git Sha - fabecbf3778cac6cd714d5ef6d3a6371d93aa2f4

@swift-ci
Copy link
Contributor

swift-ci commented Dec 6, 2018

Build failed
Swift Test Linux Platform
Git Sha - fabecbf3778cac6cd714d5ef6d3a6371d93aa2f4

@AnnaZaks AnnaZaks merged commit 21f3a50 into swiftlang:swift-5.0-branch Dec 6, 2018
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.

3 participants