Skip to content

Commit 4b250b2

Browse files
committed
[cast-opt] Fix obvious bug.
Found via inspection. The code is supposed to check if either the source or the target is NSError and in such a case bail.
1 parent e2a5ddf commit 4b250b2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/SILOptimizer/Utils/CastOptimizer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -654,7 +654,7 @@ CastOptimizer::optimizeBridgedCasts(SILDynamicCastInst dynamicCast) {
654654

655655
if ((CanBridgedSourceTy && CanBridgedSourceTy->getAnyNominal() ==
656656
M.getASTContext().getNSErrorDecl()) ||
657-
(CanBridgedTargetTy && CanBridgedSourceTy->getAnyNominal() ==
657+
(CanBridgedTargetTy && CanBridgedTargetTy->getAnyNominal() ==
658658
M.getASTContext().getNSErrorDecl())) {
659659
// FIXME: Can't optimize bridging with NSError.
660660
return nullptr;

0 commit comments

Comments
 (0)