Skip to content

Commit bdafd9b

Browse files
Merge pull request #40739 from nate-chandler/cherrypick/copy-propagation/fixed-assert/release/5.6
[5.6] [ShrinkBorrowScope] Fixed assert.
2 parents 4a9cd5b + dc29673 commit bdafd9b

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lib/SILOptimizer/Utils/ShrinkBorrowScope.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,13 @@ void ShrinkBorrowScope::findBarriers() {
315315
// At that time, it was checked that this block (along with all that
316316
// successor's other predecessors) had a terminator over which the borrow
317317
// scope could be shrunk. Shrink it now.
318-
assert(tryHoistOverInstruction(block->getTerminator()));
318+
#ifndef NDEBUG
319+
bool hoisted =
320+
#endif
321+
tryHoistOverInstruction(block->getTerminator());
322+
#ifndef NDEBUG
323+
assert(hoisted);
324+
#endif
319325
}
320326
SILInstruction *barrier = nullptr;
321327
while ((instruction = getPreviousInstruction(instruction))) {

0 commit comments

Comments
 (0)