Skip to content

Commit 36b9ed4

Browse files
committed
Fix LifetimeDependenceDiagnostics to ignore closure captures
ClosureLifetimeFixup now emits mark_dependence [nonescaping]. Those should be ignored by diagnostics. In the capture case, the dependence has already been resolved, and may not match the SIL patterns that we expect for source-level lifetime dependencies. Fixes rdar://125375685 ([nonescapable] Fix lifetime-dependence diagnostics in the stdlib)
1 parent a99ea62 commit 36b9ed4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

SwiftCompilerSources/Sources/Optimizer/FunctionPasses/LifetimeDependenceDiagnostics.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ let lifetimeDependenceDiagnosticsPass = FunctionPass(
4545
}
4646
}
4747
for instruction in function.instructions {
48-
if let markDep = instruction as? MarkDependenceInst {
48+
if let markDep = instruction as? MarkDependenceInst, markDep.isUnresolved {
4949
if let lifetimeDep = LifetimeDependence(markDep, context) {
5050
analyze(dependence: lifetimeDep, context)
5151
}

0 commit comments

Comments
 (0)