mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
InteriorLiveness has a new "visitInnerUses" mode used by DestroyHoisting. That mode may visit dependent values, which was not valid for noescape closures. ClosureLifetimeFixup inserts destroys of noescape closures after the destroys of the captures. So following such dependent value could result in an apparent use-after-destroy. This causes DestroyHoisting to insert redundant destroys. Fix: InteriorUses will conservatively only follow dependent values if they are escapable. Non-escapable values, like noescape closures are now considered escapes of the original value that the non-escapable value depends on. This can be improved in the future, but we may want to rewrite ClosureLifetimeFixup first. Fixes the root cause of: rdar://146142041
12 KiB
12 KiB