Skip to content

[6.0][ClangImporter/SILGen] A couple of fixes for ObjC and Sendable interaction #74575

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 2 commits into from
Jun 21, 2024

Conversation

xedin
Copy link
Contributor

@xedin xedin commented Jun 20, 2024

  • Explanation:

    Fixes a couple of crashers recently discovered when ObjC API have been annotated with @Sendable attribute.

    • If the context indicates that the result of id-to-Any should be placed in some pre-allocated buffer, let's not attempt marker existential transformation because that would much the expected layout already.
    • : AnyObject was added only if there were no other constraints because all of them would imply it before, with introduction of Sendable this is no longer the case. Let's add AnyObject constraint unconditionally and let generic signature builder deal with the redundancy.
  • Main Branch PRs: [ClangImporter] Always add AnyObject constraint to generic parameters #74492, [SILGen] Fix any Sendable to Any bridging when result should be p… #74483

  • Resolves: rdar://127520993

  • Risk: Low

  • Reviewed By: @jckarter

  • Testing: Existing test-cases were modified and new tests were added.

xedin added 2 commits June 20, 2024 10:18
…laced in a buffer

If the context indicates that the result of `id-to-Any` should be
placed in some pre-allocated buffer, let's not attempt marker existential
transformation because that would much the expected layout already.

(cherry picked from commit 1e9e351)
`: AnyObject` was added only if there were no other constraints because
all of them would imply it before, with introduction of `Sendable` this
is no longer the case. Let's add `AnyObject` constraint unconditionally
and let generic signature builder deal with the redundancy.

Resolves: rdar://127520993
(cherry picked from commit 4cc69b8)
@xedin xedin added 🍒 release cherry pick Flag: Release branch cherry picks swift 6.0 labels Jun 20, 2024
@xedin xedin requested a review from hborla June 20, 2024 17:26
@xedin xedin requested a review from a team as a code owner June 20, 2024 17:26
@xedin
Copy link
Contributor Author

xedin commented Jun 20, 2024

@swift-ci please test

@xedin xedin merged commit c6e3c71 into swiftlang:release/6.0 Jun 21, 2024
5 checks passed
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