Skip to content

6.0: [MoveOnlyAddressChecker] Don't complete reborrows or their adjacent phis. #73359

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

nate-chandler
Copy link
Contributor

Explanation: Fix a compiler crash caused by completing certain lifetimes during move checking.

Move-only checking relies on the completeness of lifetimes of interest. Way back in #68381 , a change was made to run lifetime completion in functions continaing move-only values; only values obviously derived from the value being checked had their lifetimes completed. Much more recently, in 874971c, an analogous change was made to complete lifetimes in functions containing move-only addresses; in the recent patch, though, rather than trying to find all the values that could be derived from the address being checked, all lifetimes in the function were completed. This doesn't quite work, though, because lifetime completion doesn't know how to deal with reborrows--it's intended to be run in a SIL prior to reborrows existing.

Here, the lifetimes that are completed in functions with move-only addresses are trimmed back to exclude values whose lifetimes depend on reborrows.

Scope: Affects noncopyable code.
Issue: rdar://127312637
Original PR: #73358
Risk: Low. Decreases the cases in which a SIL transformation is run.
Testing: Added regression test.
Reviewer: Andrew Trick ( @atrick )

@nate-chandler nate-chandler requested a review from a team as a code owner May 1, 2024 00:38
After 874971c, before running address
checking, all lifetimes in the function are completed.  That doesn't
quite work because lifetime completion expects not to encounter
reborrows or their adjacent phis.
@nate-chandler nate-chandler force-pushed the cherrypick/release/6.0/rdar127190151 branch from e4e6faf to f51edac Compare May 1, 2024 02:19
@nate-chandler
Copy link
Contributor Author

@swift-ci please test

@nate-chandler nate-chandler requested a review from tbkka May 1, 2024 14:55
@nate-chandler nate-chandler merged commit a0f488b into swiftlang:release/6.0 May 1, 2024
@nate-chandler nate-chandler deleted the cherrypick/release/6.0/rdar127190151 branch May 1, 2024 15:50
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