Skip to content

Commit 742d5f2

Browse files
committed
[SILInliner] Fix yield_once_2 dealloc_stacks.
Don't iterate users while deleting them.
1 parent da71271 commit 742d5f2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/SILOptimizer/Utils/SILInliner.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,8 @@ class BeginApplySite {
266266
EndBorrow->eraseFromParent();
267267

268268
if (auto allocation = BeginApply->getCalleeAllocationResult()) {
269-
for (auto *user : allocation->getUsers()) {
269+
SmallVector<SILInstruction *, 4> users(allocation->getUsers());
270+
for (auto *user : users) {
270271
auto *dsi = cast<DeallocStackInst>(user);
271272
dsi->eraseFromParent();
272273
}

0 commit comments

Comments
 (0)