[6.2] Fix MoveOnlyWrappedTypeEliminator handling of store_borrow. #82138
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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