Skip to content

[IRGen] Skip witness table query for protocols that do not require one #30734

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
Mar 31, 2020

Conversation

artemcm
Copy link
Contributor

@artemcm artemcm commented Mar 31, 2020

Some protocols, such as protocols marked with 'objc', do not have a Witness Table.
The code before this patch assumes all protocols do have a Witness Table when generating the layout of an OpaqueTypeDescriptor, causing an assert to be triggered for opaque return types that conform to an 'objc' protocol.

Resolves SR-12257 / rdar://problem/59740179

@artemcm
Copy link
Contributor Author

artemcm commented Mar 31, 2020

@swift-ci Please test

@theblixguy theblixguy requested a review from jckarter March 31, 2020 16:41
@artemcm artemcm force-pushed the OpaqueReturnProtocolObjc branch from 7d857b2 to 79828f0 Compare March 31, 2020 17:33
@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 7d857b2ba99b501abaa54f5b5593e3925135793a

Some protocols, such as protocols marked with 'objc', do not have a Witness Table.
The code before this patch assumes all protocols do have a Witness Table when generating the layout of an OpaqueTypeDescriptor, causing an assert to be triggered for opaque return types that conform to an 'objc' protocol.

Fixes SR-12257 / rdar://problem/59740179
@artemcm artemcm force-pushed the OpaqueReturnProtocolObjc branch from 79828f0 to 1b11e87 Compare March 31, 2020 17:56
@artemcm
Copy link
Contributor Author

artemcm commented Mar 31, 2020

I think '-verify' causes import Foundation to fail on Linux?
@swift-ci Please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 7d857b2ba99b501abaa54f5b5593e3925135793a

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 7d857b2ba99b501abaa54f5b5593e3925135793a

@theblixguy
Copy link
Collaborator

theblixguy commented Mar 31, 2020

Linux failure is unrelated to this change (PR which caused failure has been reverted here).

@swift-ci please test Linux

Copy link
Contributor

@jckarter jckarter left a comment

Choose a reason for hiding this comment

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

Thanks for fixing this!

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.

4 participants