Skip to content

SIL: @objc thunks should have private SIL linkage #59293

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 7, 2022

Conversation

slavapestov
Copy link
Contributor

Previously we gave them the same SIL linkage as the method, then changed
the LLVM IR linkage to 'internal' (which is roughly equivalent to
SIL 'private') in IRGen.

This would crash in the SIL verifier if an @objc method was
'@_alwaysEmitIntoClient'. While such a combination of attributes is
silly since '@objc' methods are intrinsically part of the ABI, we
should not crash in this case.

The simplest fix is to just set the linkage to private at the SIL
level, avoiding the IRGen hack entirely.

Previously we gave them the same SIL linkage as the method, then changed
the LLVM IR linkage to 'internal' (which is roughly equivalent to
SIL 'private') in IRGen.

This would crash in the SIL verifier if an @objc method was
'@_alwaysEmitIntoClient'. While such a combination of attributes is
silly since '@objc' methods are intrinsically part of the ABI, we
should not crash in this case.

The simplest fix is to just set the linkage to private at the SIL
level, avoiding the IRGen hack entirely.
@slavapestov slavapestov requested a review from jckarter June 7, 2022 05:17
@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test

@slavapestov slavapestov merged commit 831be7f into swiftlang:main Jun 7, 2022
ahoppen added a commit to ahoppen/swift that referenced this pull request Jun 8, 2022
…k-linkage"

This reverts commit 831be7f, reversing
changes made to 8b77860.
slavapestov added a commit to slavapestov/swift that referenced this pull request Jun 8, 2022
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.

1 participant