mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[DI] InitAccessors: Ignore unreachable blocks when check property initialization inside of an init accessor
This commit is contained in:
committed by
Pavel Yaskevich
parent
645e8df6bd
commit
2149a4630a
@@ -1182,6 +1182,12 @@ void LifetimeChecker::doIt() {
|
||||
while (returnBB != F.end()) {
|
||||
auto *terminator = returnBB->getTerminator();
|
||||
|
||||
// If this is an unreachable block, let's ignore it.
|
||||
if (isa<UnreachableInst>(terminator)) {
|
||||
++returnBB;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!isInitializedAtUse(DIMemoryUse(terminator, DIUseKind::Load, 0, 1)))
|
||||
diagnoseMissingInit();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user