Skip to content

IRGen: Fix enum lowering with -enable-resilience-bypass #16488

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

Merged
merged 2 commits into from
May 10, 2018

Conversation

slavapestov
Copy link
Contributor

Fixes rdar://problem/40034143.

The layout of an enum type will only use spare bits if the
payload types have a fixed size in all resilience domains
where they are visible. In practice, this means that:

- If the enum is internal or resilient, we can use spare bits
  if the payload types are fixed size from inside the current
  module.

- If the enum is public and not resilient, we can use spare bits
  if the payload types are fixed size from all resilience
  domains.

The bug was that the 'fixed size in all resilience domains'
check was returning true for resilient types when the
-enable-resilience-bypass flag was on. This is wrong, because
this meant that building a module with and without
-enable-resilience-bypass could produce different lowerings
for enum types.

Fixes <rdar://problem/40034143>.
@slavapestov
Copy link
Contributor Author

@swift-ci Please test

@slavapestov slavapestov merged commit e22bed2 into swiftlang:master May 10, 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.

1 participant