Skip to content

[6.2] Fix MoveOnlyWrappedTypeEliminator handling of store_borrow. #82138

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
Jun 10, 2025

Conversation

atrick
Copy link
Contributor

@atrick atrick commented Jun 10, 2025

Defer visiting an instruction until its operands have been visited. Otherwise,
this pass will crash during ownership verification with invalid operand
ownership.

Fixes rdar://152879038 ([moveonly] MoveOnlyWrappedTypeEliminator ownership
verifier crashes on @_addressableSelf)

main PR: #82137

(cherry picked from commit 16fffd1)

--- CCC ---

Explanation: A function argument with an ownership modifier (borrowing/consuming) is a no-implicit-copy value. After diagnostics, a special pass lowers these values down to regular copyable values. That pass has an algorithm flaw that processed instructions in the wrong order.

Scope: The ownership verifier crashes during this pass. This probably would not show up in release builds, but verifier crashes make it difficult to diagnose other errors.

Radar/SR Issue: rdar://152879038 ([moveonly] MoveOnlyWrappedTypeEliminator ownership verifier crashes on @_addressableSelf)

main PR: #82137

Risk: Low

Testing: Added source-level and SIL unit tests

Reviewer: Nate Chandler

Defer visiting an instruction until its operands have been visited. Otherwise,
this pass will crash during ownership verification with invalid operand
ownership.

Fixes rdar://152879038 ([moveonly] MoveOnlyWrappedTypeEliminator ownership
verifier crashes on @_addressableSelf)

(cherry picked from commit 16fffd1)
@atrick atrick requested a review from a team as a code owner June 10, 2025 02:50
@atrick atrick added 🍒 release cherry pick Flag: Release branch cherry picks swift 6.2 labels Jun 10, 2025
@atrick
Copy link
Contributor Author

atrick commented Jun 10, 2025

@swift-ci test

@atrick atrick enabled auto-merge June 10, 2025 04:43
@atrick atrick disabled auto-merge June 10, 2025 04:44
@atrick atrick enabled auto-merge June 10, 2025 05:02
@atrick atrick merged commit f861c2f into swiftlang:release/6.2 Jun 10, 2025
5 checks passed
@atrick atrick deleted the 62-fix-moveonly-storeborrow branch June 10, 2025 17:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🍒 release cherry pick Flag: Release branch cherry picks swift 6.2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants