Skip to content

[6.2] LifetimeDependenceDefUseAddressWalker: avoid infinite recursion. #81247

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

Conversation

atrick
Copy link
Contributor

@atrick atrick commented May 2, 2025

This utility is used by DependentAddressUseDefWalker which now conservatively
follows all possible uses. This could result in the same address being reached
multiple times during a def-use walk. Ensure that we don't infinitely recurse.

There is no small test case for this, but the fix is trivial and standard
practice for such walkers, and this is hit quickly in real usage, so there is no
danger of it regressing.

Fixes rdar://150403948 ([nonescapable] Infinite recursion compiler crash in
lifetime dependence checking)

(cherry picked from commit 4512927)

main PR: #81246

Risk: Very low. Simply enables an existing recursion check. It can only affect the code path that was already crashing.

Testing: The radar includes a unit test but it isn't appropriate as a lit test.

Reviewed by: @meg-gupta

This utility is used by DependentAddressUseDefWalker which now conservatively
follows all possible uses. This could result in the same address being reached
multiple times during a def-use walk. Ensure that we don't infinitely recurse.

There is no small test case for this, but the fix is trivial and standard
practice for such walkers, and this is hit quickly in real usage, so there is no
danger of it regressing.

Fixes rdar://150403948 ([nonescapable] Infinite recursion compiler crash in
lifetime dependence checking)

(cherry picked from commit 4512927)
@atrick atrick requested a review from a team as a code owner May 2, 2025 00:14
@atrick atrick added 🍒 release cherry pick Flag: Release branch cherry picks swift 6.2 labels May 2, 2025
@atrick atrick requested a review from tbkka May 2, 2025 00:16
@atrick
Copy link
Contributor Author

atrick commented May 2, 2025

@swift-ci test

@atrick atrick enabled auto-merge May 2, 2025 00:16
@atrick atrick merged commit 44c39bb into swiftlang:release/6.2 May 2, 2025
5 checks passed
@atrick atrick deleted the 62-rdar150403948-lifedep-walker-recurse branch May 2, 2025 15:23
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