Skip to content
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

SILVerifier: fix a wrong check for witness_method instructions #77972

Merged
merged 1 commit into from
Dec 5, 2024

Conversation

eeckstein
Copy link
Contributor

Consider that the lookup-type can be an opaque return type.

Also fixing the SILPrinter.

Fixes a verifier crash
#77955
rdar://140939536

Consider that the lookup-type can be an opaque return type.

Also fixing the SILPrinter.

Fixes a verifier crash
swiftlang#77955
140939536
@eeckstein eeckstein requested a review from jckarter as a code owner December 5, 2024 06:22
@eeckstein
Copy link
Contributor Author

@swift-ci smoke test

WMI->getMember().getDecl()->getInterfaceType().print(
PrintState.OS, QualifiedSILTypeOptions);
if (!WMI->getTypeDependentOperands().empty()) {
if ((getLocalArchetypeOf(lookupType) || lookupType->hasDynamicSelfType()) && !WMI->getTypeDependentOperands().empty()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

The commit message talks about opaque archetypes, what's the connection?

Copy link
Contributor Author

@eeckstein eeckstein Dec 5, 2024

Choose a reason for hiding this comment

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

The SILPrinter prints the first type dependent operand as explicit operand. I don't know why.
So far it was the assumption that if the lookupType is an opened archetype then there is exactly 1 type dependent operand. But this is not true for opaque return types, because those have opened archetypes in the substitution list. This SILPrinter change "restores" the original behavior that the explicit operand is printed if the lookupType is an opened archetype.

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