Skip to content

[DebugInfo] Fix infinite recursion when opaque return type is defined inside function returning it #81794

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
Jul 24, 2025

Conversation

augusto2112
Copy link
Contributor

@augusto2112 augusto2112 commented May 28, 2025

A stack overflow would happen when the compiler tried emitting debug info for a function whose opaque return type was declared inside the function itself. This fixes the issue by emitting a forward declaration for the function before emitting it.

rdar://150313956

@augusto2112
Copy link
Contributor Author

@swift-ci smoke test

@augusto2112 augusto2112 changed the title [DebugInfo] Fix infinite recursion when opaque return type is defined [DebugInfo] Fix infinite recursion when opaque return type is defined inside function returning it May 28, 2025
Copy link
Contributor

@adrian-prantl adrian-prantl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks safe & correct, thanks!

inside function returning it

A stack overflow would happen when the compiler tried emitting debug
info for a function whose opaque return type was declared inside the
function itself. This fixes the issue by emitting a forward declaration
for the function before emitting it.

rdar://150313956
@augusto2112 augusto2112 force-pushed the fix-opaque-infinite-rec branch from d09ef33 to c03831f Compare July 23, 2025 22:24
@augusto2112
Copy link
Contributor Author

@swift-ci smoke test

@augusto2112 augusto2112 enabled auto-merge July 23, 2025 22:24
@augusto2112 augusto2112 merged commit 9376bdc into swiftlang:main Jul 24, 2025
3 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.

3 participants