Skip to content

SILGen: insert an end_lifetime in the throw-branch of a Builtin.emplace #81567

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
merged 1 commit into from
May 17, 2025

Conversation

eeckstein
Copy link
Contributor

When the called closure throws an error, it needs to clean up the buffer. This means that the buffer is uninitialized at this point.

We need an end_lifetime so that the move-only checker doesn't insert a wrong destroy_addr because it thinks that the buffer is initialized.

Fixes a mis-compile.

rdar://151461109

…place`

When the called closure throws an error, it needs to clean up the buffer.
This means that the buffer is uninitialized at this point.

We need an `end_lifetime` so that the move-only checker doesn't insert a wrong `destroy_addr` because it thinks that the buffer is initialized.

Fixes a mis-compile.

rdar://151461109
@eeckstein eeckstein requested review from a team, kavon and jckarter as code owners May 16, 2025 20:00
@eeckstein eeckstein requested review from Azoy and removed request for kavon May 16, 2025 20:00
@eeckstein
Copy link
Contributor Author

@swift-ci smoke test

@eeckstein eeckstein requested review from atrick and nate-chandler May 16, 2025 20:01
@nate-chandler nate-chandler removed their request for review May 16, 2025 20:58
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.

Makes sense to me

@eeckstein
Copy link
Contributor Author

@swift-ci smoke test linux

@eeckstein eeckstein enabled auto-merge May 17, 2025 18:38
@eeckstein eeckstein merged commit d985bf6 into swiftlang:main May 17, 2025
3 checks passed
@eeckstein eeckstein deleted the fix-builtin-emplace branch May 18, 2025 06:08
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