Skip to content

[5.7-04182022][Static Mirror] Gather local type extension conformance infos correctly #58985

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

Conversation

artemcm
Copy link
Contributor

@artemcm artemcm commented May 19, 2022

Cherry-pick of #58982

• Explanation: Conformance Infos for nominal type declarations reference the conforming type by storing an offset to the address in the binary where the type's type descriptor is located. Conformance infos for conformances applied to an extension of a type use a different mechanism: they use an indirect reference to a dynamic symbol, which may be an external symbol or a resolved address to a local type descriptor. It is the latter case that the conformance-gather implementation was missing that is added in this PR.
• Scope of Issue: Users of libSwiftStaticMirror who attempt to extract conformances that were specified on extensions to locally-defined types would not see them in the expected output.
• Risk: Low, this change only affects the code-path of binary conformance extraction.
• Automated Testing: Automated test added to the compiler test suite

Resolves rdar://93578419

Conformance Infos for nominal type declarations reference the conforming type by storing an offset to the address in the binary where the type's type descriptor is located. Conformance infos for conformances applied to an extension of a type use a different mechanism: they use an indirect reference to a dynamic symbol, which may be an external symbol **or** a resolved address to a local type descriptor. It is the latter case that the conformance-gather implementation was missing that is added in this PR.

Resolves rdar://93578419
@artemcm artemcm requested a review from a team as a code owner May 19, 2022 17:01
@artemcm
Copy link
Contributor Author

artemcm commented May 19, 2022

@swift-ci please test

@artemcm
Copy link
Contributor Author

artemcm commented May 19, 2022

@swift-ci please test macOS platform

1 similar comment
@artemcm
Copy link
Contributor Author

artemcm commented May 20, 2022

@swift-ci please test macOS platform

@artemcm artemcm merged commit d811642 into swiftlang:release/5.7-04182022 May 24, 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.

2 participants