Skip to content

[6.2] Fix an inliner crash when inlining begin_apply with scoped lifetime dependence #82224

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 14, 2025

Conversation

meg-gupta
Copy link
Contributor

Explanation: LifetimeDependenceInsertion inserts mark_dependence on the token result of a begin_apply when it yields a lifetime dependent value. When such a begin_apply gets inlined, the inliner can crash because of the remaining uses of the token result.

Fix this by inserting mark_dependence on parameter operands that are lifetime dependence sources and deleting the mark_dependence on the token result in the inliner.

Scope: Affects lifetime dependencies on coroutines. No stdlib coroutines have lifetime dependencies.

Risk: Low

Issue: rdar://151568816

Reviewer: @atrick

Main PR: #82033

Testing: Added unit tests, CI testing

@meg-gupta meg-gupta requested a review from tbkka June 12, 2025 19:06
@meg-gupta
Copy link
Contributor Author

@swift-ci test

@meg-gupta meg-gupta marked this pull request as ready for review June 12, 2025 19:06
@meg-gupta meg-gupta requested a review from a team as a code owner June 12, 2025 19:06
@meg-gupta meg-gupta force-pushed the fixinlinercrashcp branch from d934758 to fe35118 Compare June 12, 2025 20:33
@meg-gupta
Copy link
Contributor Author

@swift-ci test

@meg-gupta meg-gupta enabled auto-merge June 12, 2025 20:34
@meg-gupta meg-gupta force-pushed the fixinlinercrashcp branch from fe35118 to d5b82a3 Compare June 13, 2025 21:18
@meg-gupta
Copy link
Contributor Author

@swift-ci test

@meg-gupta meg-gupta merged commit 2bbc1c3 into swiftlang:release/6.2 Jun 14, 2025
5 checks passed
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