Skip to content

Disable an assert in LinearLifetimeChecker pending design changes. #34771

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 17, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions lib/SIL/Verifier/LinearLifetimeChecker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -551,9 +551,17 @@ LinearLifetimeChecker::Error LinearLifetimeChecker::checkValueImpl(
Optional<function_ref<void(SILBasicBlock *)>> leakingBlockCallback,
Optional<function_ref<void(Operand *)>>
nonConsumingUseOutsideLifetimeCallback) {
assert((!consumingUses.empty()
|| deadEndBlocks.isDeadEnd(value->getParentBlock())) &&
"Must have at least one consuming user?!");
// FIXME: rdar://71240363. 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.
//
// assert((!consumingUses.empty()
// || deadEndBlocks.isDeadEnd(value->getParentBlock())) &&
// "Must have at least one consuming user?!");

State state(value, visitedBlocks, errorBuilder, leakingBlockCallback,
nonConsumingUseOutsideLifetimeCallback, consumingUses,
Expand Down