Skip to content

Fix handling of none value stores to non-trivial enums in Mem2Reg #68325

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 1 commit into from
Sep 5, 2023

Conversation

meg-gupta
Copy link
Contributor

@meg-gupta meg-gupta commented Sep 5, 2023

We allow none values to be stored to a non-trivial enum. For such a store_borrow, LiveValues::forValues used an Owned storage type, but endLexicalLifetime expected Guaranteed storage type, leading to a compiler crash.

For store_borrow, use the LiveValues::forGuaranteed and for store use LiveValues::forOwned to avoid this.

Fixes rdar://114390472

We allow none values to be stored to a non-trivial enum.
For such store_borrow, `LiveValues::forValues` used
an Owned storage type, but endLexicalLifetime expected Guaranteed
storage type, leading to a compiler crash.

For store_borrow, use the LiveValues::forGuaranteed and for store
use LiveValues::forOwned to avoid this.

Fixes rdar://114390472
@meg-gupta meg-gupta requested a review from atrick September 5, 2023 06:33
@meg-gupta
Copy link
Contributor Author

@swift-ci test

Copy link
Contributor

@nate-chandler nate-chandler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM Thanks!

@meg-gupta meg-gupta merged commit f177be0 into swiftlang:main Sep 5, 2023
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.

2 participants