Skip to content

[4.1] [ClangImporter] Fix handling of bitfields in unions #14426

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 Feb 6, 2018

  • Explanation: Both unions and bitfields need to be handled specially when importing C types into Swift, but we were trying to apply both special handlings for bitfields in unions. In +Asserts builds this led to an assertion failure; in -Asserts builds it had the wrong behavior.
  • Scope: Only affects bitfields in unions.
  • Issue: rdar://problem/37242238
  • Reviewed by: @jckarter
  • Risk: Low. Everything that previously worked will continue doing what it did before.
  • Testing: Added compiler regression tests

Previously this caused an assertion failure in +Asserts builds
and incorrect behavior in -Asserts builds.

rdar://problem/37242238
(cherry picked from commit c06cc01)
@jrose-apple
Copy link
Contributor Author

@swift-ci Please test

@jrose-apple
Copy link
Contributor Author

@swift-ci Please nominate

@jrose-apple
Copy link
Contributor Author

@swift-ci Please nominate

@jrose-apple jrose-apple merged commit c1df8a0 into swiftlang:swift-4.1-branch Feb 6, 2018
@jrose-apple jrose-apple deleted the 4.1-bitfields-unions-porque-no-los-dos branch February 6, 2018 20:46
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