Skip to content

IDETool: Register SourceFile for replaced function body #76971

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

tshortli
Copy link
Contributor

@tshortli tshortli commented Oct 11, 2024

This prevents a nullptr dereference in ASTScope::unqualifiedLookup() after querying for the SourceFile containing a given source location.

Fixes rdar://137652856 and #76944.

This prevents a nullptr dereference in `ASTScope::unqualifiedLookup()` after
querying for the `SourceFile` containing a give source location.

Fixes rdar://137652856 and swiftlang#76944.
@tshortli
Copy link
Contributor Author

@swift-ci please smoke test

Copy link
Member

@ahoppen ahoppen 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 @tshortli 😍

@tshortli tshortli merged commit 11b613d into swiftlang:main Oct 11, 2024
3 checks passed
@tshortli tshortli deleted the sourcekit-ast-scope-unqualified-lookup-crash branch October 11, 2024 06:07
@DougGregor
Copy link
Member

Thank you @ahoppen for the amazing reproducer and @tshortli for the fix!

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.

Nullptr access after discarding ASTContext for code completion during unqualified lookup after exceeding MaxASTReuseCount
3 participants