Skip to content

[LifetimeCompletion] Don't destroy alloc_boxes. #73155

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

Merged

Conversation

nate-chandler
Copy link
Contributor

A destroy_value of an alloc_box unconditionally destroys the value within the box. On unreachable paths, such memory may not be initialized, so it cannot be destroyed unconditionally. Moreover, destroying values stored in memory is outside the purview of OSSA lifetime completion.

Rather than repeating the same expression that already defines it.
@nate-chandler nate-chandler force-pushed the lifetime-completion/20240419/1 branch 2 times, most recently from 22c0cd8 to aac6fae Compare April 20, 2024 00:36
When deallocating a partially allocated class in the trapping branch of
an unfailable cast, cast back down to the subclass which is being
partially deallocated before emitting the dealloc partial ref
instruction.
A destroy_value of an alloc_box unconditionally destroys the value
within the box.  On unreachable paths, such memory may not be
initialized, so it cannot be destroyed unconditionally.  Moreover,
destroying values stored in memory is outside the purview of OSSA
lifetime completion.
@nate-chandler nate-chandler force-pushed the lifetime-completion/20240419/1 branch from aac6fae to 6a01bf4 Compare April 22, 2024 03:56
@nate-chandler
Copy link
Contributor Author

@swift-ci please test

Copy link
Contributor

@atrick atrick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@nate-chandler nate-chandler merged commit a354528 into swiftlang:main Apr 22, 2024
@nate-chandler nate-chandler deleted the lifetime-completion/20240419/1 branch April 22, 2024 18:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants