mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
The reason why we want to do this is that if we treat it as a true forwarding use, we will visit the uses of the trivial value and treat those as liveness uses. Since the trivial value is not tied to the lifetime of the underlying noncopyable value, this can be outside of the lifetime of said value causing a memory lifetime error. By just treating the guaranteed forwarding instruction with all trivial values as a liveness use, we avoid this problem. I added a SIL test, a Swift test, and an Interpreter test that validates this behavior. rdar://111497657
73 KiB
73 KiB