Skip to content

Fix dependent protocol conformance records #15573

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

Conversation

slavapestov
Copy link
Contributor

Protocol conformance records for dependent conformances (ie, requiring instantiation) directly referenced the witness table pattern and not the accessor function. This is incorrect. To prevent the problem from happening again, give witness table patterns a different mangling with private linkage. Also, change the runtime use witness table accessors rather than direct references to witness tables in the Foundation module in a couple of spots. These conformances are resilient and also require instantiation.

@slavapestov slavapestov force-pushed the dependent-conformance-records branch from ab54912 to 9dba1ff Compare March 28, 2018 13:41
Copy link
Member

@DougGregor DougGregor left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks for re-using isDependentConformance.

@slavapestov slavapestov force-pushed the dependent-conformance-records branch 2 times, most recently from 1504963 to 6c9df59 Compare March 29, 2018 01:06
…references for Error bridging

This breaks with resilient conformances once the pattern symbol
is no longer public.
…e the witness table accessor function

... and not the pattern, which is about to get non-public linkage.
Witness tables for conformances that require runtime instantiation
should not be public, because it is an error to directly reference
such a symbol from outside the module.

Use a different mangling for witness table patterns and give them
non-public linkage.
@slavapestov slavapestov force-pushed the dependent-conformance-records branch from 6c9df59 to 30a3e75 Compare March 29, 2018 03:59
@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test

@slavapestov slavapestov merged commit 0a0a3c6 into swiftlang:master Mar 29, 2018
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.

3 participants