Skip to content

[6.0] [ClangImporter] Switch lookupGlobalsAsMembers to take a non-optional EffectiveClangContext #74788

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

Conversation

hamishknight
Copy link
Contributor

6.0 cherry-pick of #74683

  • Explanation: Fixes a crash that could occur when looking up a member in the ClangImporter
  • Scope: Affects name lookup for imported decls
  • Issue: rdar://129619711
  • Risk: Low, the fix is very straightforward
  • Testing: No test unfortunately as haven't been able to come up with a reproducer, passes the existing test suite
  • Reviewer: Becca Royal-Gordon

…l EffectiveClangContext

The only caller is `loadNamedMembers`, and that
passes in a non-optional EffectiveClangContext,
meaning that we'd miss the case when
`getEffectiveClangContext` returns `nullptr`, crashing
in `translateContext`. No test case unfortunately
as I haven't been able to come up with a reproducer.

rdar://129619711
@hamishknight hamishknight added 🍒 release cherry pick Flag: Release branch cherry picks swift 6.0 labels Jun 27, 2024
@hamishknight hamishknight requested a review from bnbarham June 27, 2024 17:11
@hamishknight hamishknight requested a review from a team as a code owner June 27, 2024 17:11
@hamishknight
Copy link
Contributor Author

@swift-ci please test

@hamishknight hamishknight merged commit 67b9ee0 into swiftlang:release/6.0 Jun 28, 2024
5 checks passed
@hamishknight hamishknight deleted the null-context-6.0 branch June 28, 2024 10:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🍒 release cherry pick Flag: Release branch cherry picks swift 6.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants