Skip to content

Commit 670b82b

Browse files
committed
[SILGen] In emitDynamicPackLoop, branch to the loop latch only if
there's a valid insertion point.
1 parent c8fe36d commit 670b82b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/SILGen/SILGenPack.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -810,7 +810,7 @@ void SILGenFunction::emitDynamicPackLoop(
810810
{
811811
FullExpr scope(Cleanups, CleanupLocation(loc));
812812
emitBody(curIndex, packExpansionIndex, packIndex);
813-
if (loopLatch) {
813+
if (loopLatch && B.hasValidInsertionPoint()) {
814814
B.createBranch(loc, loopLatch);
815815
}
816816
}

0 commit comments

Comments
 (0)