Skip to content
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

[lldb] Prevent a bunch of potential use-after-free with SwiftASTContext #9664

Open
wants to merge 1 commit into
base: swift/release/6.1
Choose a base branch
from

Conversation

adrian-prantl
Copy link

TypeSystemSwiftTypeRef::GetSwiftASTContext() may destroy and recreate any of the SwiftASTContexts in its map of contexts, so clients need to hold on to a shared pointer to avoid another thread destroying the context while it is in use.

rdar://71278998

TypeSystemSwiftTypeRef::GetSwiftASTContext() may destroy and recreate
any of the SwiftASTContexts in its map of contexts, so clients need to
hold on to a shared pointer to avoid another thread destroying the
context while it is in use.

rdar://71278998
@adrian-prantl
Copy link
Author

@swift-ci test

@@ -78,7 +80,7 @@ class SwiftREPL : public REPL {
CompletionRequest &request) override;

private:
SwiftASTContextForExpressions *m_swift_ast = nullptr;
SwiftASTContextForExpressionsSP m_swift_ast;

Choose a reason for hiding this comment

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

If you're trying to keep churn to a minimum, feel free to ignore this, but otherwise this should be m_swift_ast_sp. Looks like you're already touching a lot of callosities.

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