Skip to content

Commit 0dd54eb

Browse files
committed
Fix an assertion under -disable-availability-checking in zippered mode
1 parent 193b886 commit 0dd54eb

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

lib/SILGen/SILGenDecl.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1896,7 +1896,8 @@ void SILGenFunction::emitStmtCondition(StmtCondition Cond, JumpDest FalseDest,
18961896
assert(!OSVersion.isEmpty()
18971897
|| getASTContext().LangOpts.DisableAvailabilityChecking);
18981898

1899-
if (getASTContext().LangOpts.TargetVariant) {
1899+
if (getASTContext().LangOpts.TargetVariant &&
1900+
!getASTContext().LangOpts.DisableAvailabilityChecking) {
19001901
// We're building zippered, so we need to pass both macOS and iOS
19011902
// versions to the the runtime version range check. At run time
19021903
// that check will determine what kind of process this code is loaded
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// RUN: %target-swift-emit-silgen -target %target-cpu-apple-macosx13 -target-variant %target-cpu-apple-ios16-macabi -disable-availability-checking %s -verify
2+
// REQUIRES: OS=macosx
3+
4+
func foo() {
5+
if #available(macOS 10.15, *) {}
6+
}

0 commit comments

Comments
 (0)