Skip to content

TempRValueElimination: fix a problem with leaking enum values #41724

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
Mar 8, 2022

Conversation

eeckstein
Copy link
Contributor

When optimizing an enum store to an alloc_stack, require that all uses are in the same block.
Otherwise it could be a switch_enum of an optional where the none-case does not have a destroy of the enum value.
After transforming such an alloc_stack, the value would leak in the none-case block.

Fixes a OSSA verification error.

When optimizing an enum `store` to an `alloc_stack`, require that all uses are in the same block.
Otherwise it could be a `switch_enum` of an optional where the none-case does not have a destroy of the enum value.
After transforming such an `alloc_stack`, the value would leak in the none-case block.

Fixes a OSSA verification error.
@eeckstein
Copy link
Contributor Author

@swift-ci smoke test

@eeckstein eeckstein merged commit af354e3 into swiftlang:main Mar 8, 2022
@eeckstein eeckstein deleted the fix-temprvalueopt branch March 8, 2022 16:32
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