Skip to content

SILGen: Fix if #available for unavailable custom domains in zippered modules #81767

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

Conversation

tshortli
Copy link
Contributor

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.

…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 force-pushed the fix-zippered-custom-availability-queries branch from 64150f2 to 4aa516a Compare May 25, 2025 15:27
@tshortli
Copy link
Contributor Author

@swift-ci please test

@tshortli tshortli merged commit 7387f85 into swiftlang:main May 27, 2025
5 checks passed
@tshortli tshortli deleted the fix-zippered-custom-availability-queries branch May 27, 2025 05:26
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.

1 participant