-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[IRGen] Metadata for the conforming type in a witness table access need not be complete. #22410
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
[IRGen] Metadata for the conforming type in a witness table access need not be complete. #22410
Conversation
…ed not be complete. When calling a witness table accessor, IRGen was forcing the conforming type to have complete metadata, even though only abstract metadata is required for that query. This could cause cyclic metadata dependencies when checking conditional conformances. Fixes SR-5958.
@swift-ci please smoke test |
// CHECK-NEXT: [[Single_TYPE:%.*]] = extractvalue %swift.metadata_response [[T0]], 0 | ||
|
||
// CHECK-NEXT: [[CONDITIONAL_REQUIREMENTS:%.*]] = getelementptr inbounds [1 x i8**], [1 x i8**]* %conditional.requirement.buffer, i32 0, i32 0 | ||
// CHECK: [[CONDITIONAL_REQUIREMENTS:%.*]] = getelementptr inbounds [1 x i8**], [1 x i8**]* %conditional.requirement.buffer, i32 0, i32 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are all just that there's an extra, unused extractvalue %swift.metadata_response [[T0]], 1
, right? Would you mind just adding those lines to the test cases instead of weakening to CHECK?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in the second patch, thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't assume on the other side that the metadata passed in is complete, do we? As long as we allow it to just be abstract, this should be fine.
@rjmccall sure, I can do that |
@swift-ci please smoke test macOS |
@swift-ci please smoke test and merge |
1 similar comment
@swift-ci please smoke test and merge |
Thanks! LGTM. |
When calling a witness table accessor, IRGen was forcing the
conforming type to have complete metadata, even though only abstract
metadata is required for that query. This could cause cyclic metadata
dependencies when checking conditional conformances.
Fixes SR-5958.