New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SIL: some improvements/fixes around assign_by_wrapper #36253
Conversation
eeckstein
commented
Mar 3, 2021
- Refactoring: replace "Destination" and the ownership qualifier by a single "Mode". This represents much better the mode how the instruction is to be lowered. NFC
- Make assign_by_wrapper printable and parseable.
- Fix lowering of the assign modes for indirect results of the init-closure: The indirect result was initialized and not assigned to. The fix is to insert a destroy_addr before calling the init closure. This fixes a memory lifetime error and/or a memory leak. Found by inspection.
- Fix an iterator-invalidation crash in RawSILInstLowering
- Add tests for lowering assign_by_wrapper (a follow-up of SIL: support store_borrow and partial_apply in memory lifetime verification #36211)
* Refactoring: replace "Destination" and the ownership qualifier by a single "Mode". This represents much better the mode how the instruction is to be lowered. NFC * Make assign_by_wrapper printable and parseable. * Fix lowering of the assign modes for indirect results of the init-closure: The indirect result was initialized and not assigned to. The fix is to insert a destroy_addr before calling the init closure. This fixes a memory lifetime error and/or a memory leak. Found by inspection. * Fix an iterator-invalidation crash in RawSILInstLowering * Add tests for lowering assign_by_wrapper.
@swift-ci test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks a lot cleaner than what I wrote (not to mention the other memory leak that I missed). Thank you!
Removing the unused initializer/setter closure in lowerAssignByWrapperInstruction
should also resolve rdar://73406156
@hborla Yes, this should resolve rdar://73406156, which is https://bugs.swift.org/browse/SR-14070 |
Build failed |
@swift-ci test macOS |
Build failed |
@swift-ci test macOS |
Build failed |
@swift-ci smoke test macOS |