@@ -2859,27 +2859,29 @@ void SILGenFunction::emitSwitchFallthrough(FallthroughStmt *S) {
2859
2859
continue ;
2860
2860
for (auto var : VarLocs) {
2861
2861
auto varDecl = dyn_cast<VarDecl>(var.getFirst ());
2862
- if (varDecl && varDecl->hasName () &&
2863
- varDecl->getName () == expected->getName ()) {
2864
- SILValue value = var.getSecond ().value ;
2862
+ if (!varDecl || !varDecl->hasName () ||
2863
+ varDecl->getName () != expected->getName ()) {
2864
+ continue ;
2865
+ }
2865
2866
2866
- if (value->getType ().isAddressOnly (M)) {
2867
- context->Emission .emitAddressOnlyInitialization (expected, value);
2868
- break ;
2869
- }
2867
+ SILValue value = var.getSecond ().value ;
2870
2868
2871
- if (var.getSecond ().box ) {
2872
- auto &lowering = getTypeLowering (value->getType ());
2873
- auto argValue = lowering.emitLoad (B, CurrentSILLoc, value,
2874
- LoadOwnershipQualifier::Copy);
2875
- args.push_back (argValue);
2876
- break ;
2877
- }
2869
+ if (value->getType ().isAddressOnly (M)) {
2870
+ context->Emission .emitAddressOnlyInitialization (expected, value);
2871
+ break ;
2872
+ }
2878
2873
2879
- auto argValue = B.emitCopyValueOperation (CurrentSILLoc, value);
2874
+ if (var.getSecond ().box ) {
2875
+ auto &lowering = getTypeLowering (value->getType ());
2876
+ auto argValue = lowering.emitLoad (B, CurrentSILLoc, value,
2877
+ LoadOwnershipQualifier::Copy);
2880
2878
args.push_back (argValue);
2881
2879
break ;
2882
2880
}
2881
+
2882
+ auto argValue = B.emitCopyValueOperation (CurrentSILLoc, value);
2883
+ args.push_back (argValue);
2884
+ break ;
2883
2885
}
2884
2886
}
2885
2887
Cleanups.emitBranchAndCleanups (sharedDest, S, args);
0 commit comments