mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
When the source of a lifetime dependency is a stack-allocated address, extend the stack allocation to cover all dependent uses. This avoids miscompilations for "addressable" dependencies which arise in code built with -enable-experimental-feature AddressableTypes or AddressableParameters. It is always an error for SILGen to emit the alloc_stack in such cases. Nonetheless, we want to handle these unexpected cases gracefully in SIL as a diagnostic error rather than allowing a miscompile. Fixes rdar://159680262 ([nonescapable] diagnose dependence on a temporary copy of a global array) (cherry picked from commit 7dfd1057111425d3902b1b17cd2129c94f974027)