Skip to content

Commit ec1f3d9

Browse files
committed
Disable an assert in LinearLifetimeChecker pending design changes.
This assert does not make sense because consumingUses in some cases only contains the destroying uses. Owned values may not be destroyed because they may be converted to ValueOwnershipKind::None on all paths reaching a return. Instead, this utility needs to find liveness first considering all uses (or at least all uses that may be on a lifetime boundary). We probably then won't need this assert, but I'm leaving the FIXME as a placeholder for that work. Fixes rdar://71240363.
1 parent 9e4bdb6 commit ec1f3d9

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

lib/SIL/Verifier/LinearLifetimeChecker.cpp

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -551,9 +551,17 @@ LinearLifetimeChecker::Error LinearLifetimeChecker::checkValueImpl(
551551
Optional<function_ref<void(SILBasicBlock *)>> leakingBlockCallback,
552552
Optional<function_ref<void(Operand *)>>
553553
nonConsumingUseOutsideLifetimeCallback) {
554-
assert((!consumingUses.empty()
555-
|| deadEndBlocks.isDeadEnd(value->getParentBlock())) &&
556-
"Must have at least one consuming user?!");
554+
// FIXME: rdar://71240363. This assert does not make sense because
555+
// consumingUses in some cases only contains the destroying uses. Owned values
556+
// may not be destroyed because they may be converted to
557+
// ValueOwnershipKind::None on all paths reaching a return. Instead, this
558+
// utility needs to find liveness first considering all uses (or at least all
559+
// uses that may be on a lifetime boundary). We probably then won't need this
560+
// assert, but I'm leaving the FIXME as a placeholder for that work.
561+
//
562+
// assert((!consumingUses.empty()
563+
// || deadEndBlocks.isDeadEnd(value->getParentBlock())) &&
564+
// "Must have at least one consuming user?!");
557565

558566
State state(value, visitedBlocks, errorBuilder, leakingBlockCallback,
559567
nonConsumingUseOutsideLifetimeCallback, consumingUses,

0 commit comments

Comments
 (0)