Skip to content

Conversation

@augusto2112
Copy link
Contributor

@augusto2112 augusto2112 commented Aug 6, 2025

Explanation: Fixes an infinite recursion when generating debug info for functions where the return type is an opaque defined inside the function itself.

Scope: debug info generation of opaque types.

Issues: rdar://150313956

Original PRs: #81794

Risk: Low. The patch only affects debug info generation, and is a very straightforward, obvious change.

Testing: one new unit test added.

Reviewers: @adrian-prantl

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

(cherry picked from commit c03831f)
@augusto2112
Copy link
Contributor Author

@swift-ci 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 Aug 6, 2025
@augusto2112 augusto2112 marked this pull request as ready for review August 6, 2025 18:12
@augusto2112 augusto2112 requested a review from a team as a code owner August 6, 2025 18:12
@augusto2112 augusto2112 enabled auto-merge August 6, 2025 18:12
@augusto2112 augusto2112 merged commit 0f05528 into swiftlang:release/6.2 Aug 6, 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