Skip to content

Commit eaf82d7

Browse files
Merge pull request swiftlang#40726 from nate-chandler/copy-propagation/fixed-assert
[ShrinkBorrowScope] Fixed assert.
2 parents aa06727 + 61a3f14 commit eaf82d7

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

lib/SILOptimizer/Utils/ShrinkBorrowScope.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,13 @@ void ShrinkBorrowScope::findBarriers() {
298298
// At that time, it was checked that this block (along with all that
299299
// successor's other predecessors) had a terminator over which the borrow
300300
// scope could be shrunk. Shrink it now.
301-
assert(tryHoistOverInstruction(block->getTerminator()));
301+
#ifndef NDEBUG
302+
bool hoisted =
303+
#endif
304+
tryHoistOverInstruction(block->getTerminator());
305+
#ifndef NDEBUG
306+
assert(hoisted);
307+
#endif
302308
}
303309
SILInstruction *barrier = nullptr;
304310
while ((instruction = instruction->getPreviousInstruction())) {

test/SILOptimizer/shrink_borrow_scope.sil

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
// RUN: %target-sil-opt -copy-propagation -enable-sil-verify-all %s | %FileCheck %s
22

3-
// REQUIRES: rdar_86809882
4-
53
import Builtin
64
import Swift
75

0 commit comments

Comments
 (0)