Skip to content

Commit 78babbc

Browse files
committed
[AllocStackHoisting] New dealloc_stack's locs are cleanups.
AllocStackHoisting creates new dealloc_stack instructions. The old dealloc_stack instructions' locations' kinds are ::CleanupKind The new instructions' locations need to be of that same kind too in order not to trigger the sil verifier failure Basic block contains a non-contiguous lexical scope at -Onone when building at Onone.
1 parent 5e95304 commit 78babbc

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/IRGen/AllocStackHoisting.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,8 @@ insertDeallocStackAtEndOf(SmallVectorImpl<SILInstruction *> &FunctionExits,
118118
// Insert dealloc_stack in the exit blocks.
119119
for (auto *Exit : FunctionExits) {
120120
SILBuilderWithScope Builder(Exit);
121-
Builder.createDeallocStack(AllocStack->getLoc(), AllocStack);
121+
Builder.createDeallocStack(CleanupLocation(AllocStack->getLoc()),
122+
AllocStack);
122123
}
123124
}
124125

0 commit comments

Comments
 (0)