Files
swift-mirror/include/swift/SIL/SILValue.h
Andrew Trick 9d40198c0f SIL: fix miscompiles of non-Copyable struct/enum with deinits
The SIL optimizer has fundamental bugs that result in dropping non-Copyable
struct & enum the deinitializers.

Fix this by

1. correctly representing the ownership of struct & enum values that are
   initialized from trivial values.

2. checking move-only types before deleting forwarding instructions.

These bugs block other bug fixes. They are exposed by other unrelated SIL
optimizations to SIL. I'm sure its possible to expose the bugs with source-level
tests, but the current order of inlining and deinit devirtualization has been
hiding the bugs and complicates reproduction.
2025-08-15 15:03:50 -07:00

59 KiB