Skip to content

[CodeCompletion][ASTPrinter] Fix a null pointer dereference in PrintAST #35508

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

Conversation

nathawes
Copy link
Contributor

The code assumed that if the Type CurrentType member was set the Decl *Current member would be too. When printing the types rather than decls (like code completion does in CompletionLookup::addTypeAnnotation()) this doesn't always hold.

Resolves https://bugs.swift.org/browse/SR-13703
Resolves rdar://problem/70057258

The code assumed that if the `Type CurrentType` member was set the
`Decl *Current` member would be too. When printing the types rather than decls,
like code completion does in CompletionLookup::addTypeAnnotation(), this
doesn't always hold.

Resolves https://bugs.swift.org/browse/SR-13703
Resolves rdar://problem/70057258
@nathawes nathawes requested a review from rintaro January 20, 2021 05:05
@nathawes
Copy link
Contributor Author

@swift-ci please test

Copy link
Member

@rintaro rintaro left a comment

Choose a reason for hiding this comment

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

Thank you!

@nathawes nathawes merged commit 31d43bf into swiftlang:main Jan 20, 2021
@nathawes nathawes deleted the fix-printsingledepthofgenericsignature-completion-crash branch January 20, 2021 22:24
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