Skip to content

[lldb] Use GetASTContext() instead of accessing the ivar directly #10716

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

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

Conversation

augusto2112
Copy link

@augusto2112 augusto2112 commented May 20, 2025

  • Explanation: GetASTContext() returns a thread safe object. The SwiftASTContext class would require users of the class to use the function, but internally would access the underlying ivar directly. This patch makes sure all the accesses of the swift::ASTContext are done through the aforementioned function.
  • Scope: This fixes a basic thread safety issue when using a swift ast context.
  • Issues: rdar://143542489
  • Risk: Low. Extends usage of an existing lock mechanism.
  • Testing: Since this is a thread safety issue it's not easily testable as an isolated lldb test.
  • Reviewers: @adrian-prantl

GetASTContext() returns a thread safe object. The SwiftASTContext class
would require users of the class to use the function, but internally
would access the underlying ivar directly. This patch makes sure all the
accesses of the swift::ASTContext are done through the aforementioned
function.

rdar://143542489
@augusto2112 augusto2112 requested a review from adrian-prantl May 20, 2025 23:13
@augusto2112 augusto2112 marked this pull request as ready for review May 20, 2025 23:14
@augusto2112 augusto2112 requested a review from a team as a code owner May 20, 2025 23:14
@augusto2112
Copy link
Author

@swift-ci test

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