Skip to content

Check if decl context returned by importDeclContextOf is null #74214

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

augusto2112
Copy link
Contributor

(cherry picked from commit fedf24c)

Explanation: I've seen a crash due to importDeclContextOf returning a null decl context in importAccessorParamsAndReturnType. Most other call sites of importDeclContextOf check the returned value, so I added a check in importAccessorParamsAndReturnType too.
Risk: Low. This just adds a nullptr check.
Testing: No new tests were added (as I've only seen this on an lldb crash report I'm not sure in what situation this would arise).
Issue: rdar://127847162
Reviewer: @beccadax
Original PR: #74188

I've seen a crash due to importDeclContextOf returning a null decl
context in importAccessorParamsAndReturnType. Most other call sites of
importDeclContextOf check the returned value, so add a check in
importAccessorParamsAndReturnType too.

rdar://127847162
(cherry picked from commit fedf24c)
@augusto2112 augusto2112 requested a review from adrian-prantl June 7, 2024 17:43
@augusto2112 augusto2112 requested a review from a team as a code owner June 7, 2024 17:43
@augusto2112
Copy link
Contributor Author

@swift-ci test

@adrian-prantl adrian-prantl merged commit 490cf64 into swiftlang:release/6.0 Jun 18, 2024
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