Skip to content

Commit 65bae74

Browse files
committed
[IRGen] Pack: Fix phi source block.
Rather than the block that we _think_ we're emitting into, use the block we're actually emitting into. These aren't the same because callees can and do introduce control flow.
1 parent 07a3189 commit 65bae74

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/IRGen/GenPack.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ static void emitPackExpansionPack(
430430
auto *next = IGF.Builder.CreateAdd(phi,
431431
llvm::ConstantInt::get(IGF.IGM.SizeTy, 1));
432432

433-
phi->addIncoming(next, loop);
433+
phi->addIncoming(next, IGF.Builder.GetInsertBlock());
434434

435435
// Repeat the loop.
436436
IGF.Builder.CreateBr(check);

0 commit comments

Comments
 (0)