Skip to content

Check if decl context returned by importDeclContextOf is null #74188

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 7, 2024

Conversation

augusto2112
Copy link
Contributor

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

@augusto2112
Copy link
Contributor Author

@swift-ci smoke test

Copy link
Contributor

@beccadax beccadax left a comment

Choose a reason for hiding this comment

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

Why no test case? This fix seems obviously correct, so if you couldn't come up with one, that's fine—I'd just like to make sure you haven't overlooked it.

Other than that, just one small suggestion.

@augusto2112
Copy link
Contributor Author

Why no test case? This fix seems obviously correct, so if you couldn't come up with one, that's fine—I'd just like to make sure you haven't overlooked it.

Unfortunately I don't know how to test this. I only have a crash report from lldb which is crashing because origDC is null.

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
@augusto2112
Copy link
Contributor Author

@swift-ci smoke test

@augusto2112 augusto2112 requested a review from beccadax June 6, 2024 21:33
@augusto2112 augusto2112 merged commit e6f680d into swiftlang:main Jun 7, 2024
3 checks passed
jefferyq2 pushed a commit to jefferyq2/swift that referenced this pull request Jun 10, 2024
Check if decl context returned by importDeclContextOf is null
jefferyq2 pushed a commit to jefferyq2/swift that referenced this pull request Jun 10, 2024
Check if decl context returned by importDeclContextOf is null
jefferyq2 pushed a commit to jefferyq2/swift that referenced this pull request Jun 10, 2024
Check if decl context returned by importDeclContextOf is null
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