Skip to content

SILGen: Fix verifier error when forming keypath to subscript with resilient index type #79310

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
Feb 12, 2025

Conversation

slavapestov
Copy link
Contributor

emitKeyPathSubscriptOperands() uses the ArgEmitter to collect index arguments, which uses ResilienceExpansion::Minimal when lowering parameter types.

For this reason, lowerKeyPathSubscriptIndexTypes() should also use ResilienceExpansion::Minimal when lowering parameter types.

Otherwise, we crash in the SIL verifier due to a loadable vs address-only mismatch, if the index type is resilient.

Fixes rdar://problem/144654366.
Fixes #79304.

…ilient index type

emitKeyPathSubscriptOperands() uses the ArgEmitter to collect
index arguments, which uses ResilienceExpansion::Minimal when
lowering parameter types.

For this reason, lowerKeyPathSubscriptIndexTypes() should also
use ResilienceExpansion::Minimal when lowering parameter types.

Otherwise, we crash in the SIL verifier due to a loadable vs
address-only mismatch, if the index type is resilient.

Fixes rdar://problem/144654366.
Fixes swiftlang#79304.
@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test

@slavapestov
Copy link
Contributor Author

@swift-ci Please test source compatibility

@slavapestov slavapestov merged commit c3a33c6 into swiftlang:main Feb 12, 2025
3 of 5 checks passed
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.

Compiler crash when building swift-testing at commit 6a49142b223f214eff5da6c1224935a80e62e512
1 participant