Skip to content

Commit e9cc5d3

Browse files
committed
IRGen: disable class fast casting on Windows
It causes some problems on CI.
1 parent 9defe1f commit e9cc5d3

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

lib/IRGen/GenCast.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1061,6 +1061,11 @@ llvm::Value *irgen::emitFastClassCastIfPossible(IRGenFunction &IGF,
10611061
llvm::Value *instance,
10621062
CanType sourceFormalType,
10631063
CanType targetFormalType) {
1064+
// Currently fast casting causes a miscompile on Windows.
1065+
// TODO: fix https://bugs.swift.org/browse/SR-16112 and enable fast casting on Windows.
1066+
if (IGF.IGM.Triple.isOSWindows())
1067+
return nullptr;
1068+
10641069
if (!doesCastPreserveOwnershipForTypes(IGF.IGM.getSILModule(), sourceFormalType,
10651070
targetFormalType)) {
10661071
return nullptr;

test/Casting/fast_class_casts.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515

1616
// REQUIRES: executable_test
1717

18+
// Currently fast casting causes a miscompile on Windows.
19+
// UNSUPPORTED: windows
1820

1921
import Classes
2022
import ResilientClasses

0 commit comments

Comments
 (0)