Files
Allan Shortlidge 79e6268b55 SIL: Find more lifetime ends of on-stack closures.
visitOnStackLifetimeEnds missed the lifetime end of an on-stack closure that
was consumed indirectly. When a reabstraction thunk captured an exactly-once
or at-most-once closure, the apply consuming the thunk wasn't recognized as the
captured closure's lifetime end, which crashed with "found no consuming
operand". When such a closure was passed to the consuming parameter of an
inlined function, it was moved into the parameter's stack slot, which hit the
"partial_apply [on_stack] must be directly forwarded to a destroy_value" fatal
error.

Follow the closure into the closures that capture it, through move_value, and
through stack slots that hold nothing but the closure, including the slots
that it's moved into. Accept a destroy_addr of such a slot as the end of the
borrow scope that the closure introduces for its captures.

Resolves rdar://190773089 and rdar://190773327.
2026-10-28 16:47:37 -07:00
..
2026-09-23 15:20:59 -07:00