Skip to content

Commit bcc4a78

Browse files
committed
Fix lifetime diagnotics on an empty tuple.
Consider an empty tuple to be a value introducer rather than a forwarding instruction. Fixes rdar://153978086 ([nonescapable] compiler crash with dependency on an expression)
1 parent bac080e commit bcc4a78

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

SwiftCompilerSources/Sources/Optimizer/Utilities/ForwardingUtils.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ extension ForwardingUseDefWalker {
118118
}
119119
mutating func walkUpDefault(forwarded value: Value, _ path: PathContext)
120120
-> WalkResult {
121-
if let inst = value.forwardingInstruction {
121+
if let inst = value.forwardingInstruction, !inst.forwardedOperands.isEmpty {
122122
return walkUp(instruction: inst, path)
123123
}
124124
if let phi = Phi(value) {

0 commit comments

Comments
 (0)