Skip to content

[6.1] SILGen: Fix verifier error when forming keypath to subscript with resilient index type #79323

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

6.1 cherry-pick of #79310

  • Description: Fixes a SIL verifier failure when forming a keypath with a subscript component where one of the parameters is a resilient value type.

  • Origination: The bug has always been there.

  • Scope of the issue: swift-testing started hitting the bug recently, which forced a revert of Introduce a severity level for issues, and a 'warning' severity swift-testing#931; they'd like a fix for 6.1.

  • Reviewed by: @jckarter

  • Risk: Low.

  • Radar: rdar://problem/144654366

…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 slavapestov requested a review from a team as a code owner February 12, 2025 15:52
@slavapestov
Copy link
Contributor Author

@swift-ci Please test

@slavapestov slavapestov merged commit 23a6b30 into swiftlang:release/6.1 Feb 12, 2025
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.

3 participants