Skip to content

Commit 27d9ec8

Browse files
committed
OwnershipOptUtils: fix a wrong debug location when creating destroy_value
When taking the location from the builder's insertion point, we must make sure it's not a return location. Fixes an assertion failure. I found this during my work on simplifying borrow scopes
1 parent 91c4218 commit 27d9ec8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/SILOptimizer/Utils/OwnershipOptUtils.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -886,7 +886,7 @@ OwnershipLifetimeExtender::createPlusZeroCopy(SILValue value,
886886
boundary.visitInsertionPoints(
887887
[&](SILBasicBlock::iterator insertPt) {
888888
SILBuilderWithScope builder(insertPt);
889-
auto *dvi = builder.createDestroyValue(insertPt->getLoc(), copy);
889+
auto *dvi = builder.createDestroyValue(RegularLocation(insertPt->getLoc()), copy);
890890
callbacks.createdNewInst(dvi);
891891
},
892892
&ctx.deBlocks);

0 commit comments

Comments
 (0)