Skip to content

[6.2] SILGen: Fix if #available for unavailable custom domains in zippered modules #81776

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

Conversation

tshortli
Copy link
Contributor

@tshortli tshortli commented May 26, 2025

  • Explanation: When generating SIL for an if #available(SomeDomain) query in code being compiled for a zippered target, the generated code was mis-compiled if SomeDomain were disabled at compile time. Empty version ranges need to be handled explicitly by SILGenFunction::emitZipperedOSVersionRangeCheck().
  • Scope: Zippered modules using the CustomAvailability experimental feature.
  • Issue/Radar: rdar://150888941
  • Original PR: SILGen: Fix if #available for unavailable custom domains in zippered modules #81767
  • Risk: Low since no code should be using the CustomAvailability experimental feature yet.
  • Testing: New compiler test cases.
  • Reviewer: @nkcsgexi

…d modules.

When generating SIL for an `if #available(SomeDomain)` query in code being
compiled for a zippered target, the generated code was mis-compiled if
`SomeDomain` were disabled at compile time. Empty version ranges need to be
handled explicitly by `SILGenFunction::emitZipperedOSVersionRangeCheck()`.

SILGen still miscompiles `if #unavailable` queries generally in code compiled
for a zippered target (rdar://147929876).

Resolves rdar://150888941.
@tshortli tshortli requested a review from a team as a code owner May 26, 2025 16:23
@tshortli
Copy link
Contributor Author

@swift-ci please test

@tshortli tshortli merged commit 1be78c5 into swiftlang:release/6.2 May 27, 2025
5 checks passed
@tshortli tshortli deleted the fix-zippered-custom-availability-queries-6.2 branch May 27, 2025 05:27
@tshortli tshortli added 🍒 release cherry pick Flag: Release branch cherry picks swift 6.2 labels May 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🍒 release cherry pick Flag: Release branch cherry picks swift 6.2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants