File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed
lib/SILOptimizer/Mandatory Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -1784,14 +1784,12 @@ void CallArgRewriter::rewriteIndirectArgument(Operand *operand) {
1784
1784
});
1785
1785
} else {
1786
1786
auto borrow = argBuilder.emitBeginBorrowOperation (callLoc, argValue);
1787
- auto *storeInst =
1788
- argBuilder.emitStoreBorrowOperation (callLoc, borrow, allocInst);
1787
+ argBuilder.emitStoreBorrowOperation (callLoc, borrow, allocInst);
1789
1788
1790
1789
apply.insertAfterFullEvaluation ([&](SILBuilder &callBuilder) {
1791
- if (auto *storeBorrow = dyn_cast<StoreBorrowInst>(storeInst) ) {
1792
- callBuilder.emitEndBorrowOperation (callLoc, storeBorrow );
1790
+ if (borrow != argValue ) {
1791
+ callBuilder.emitEndBorrowOperation (callLoc, borrow );
1793
1792
}
1794
- callBuilder.emitEndBorrowOperation (callLoc, borrow);
1795
1793
callBuilder.createDeallocStack (callLoc, allocInst);
1796
1794
});
1797
1795
}
You can’t perform that action at this time.
0 commit comments