Skip to content

Fix @_rawLayout initialization to avoid spurious lifetime ends. #67633

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
Aug 1, 2023

Conversation

jckarter
Copy link
Contributor

We can't really treat them as always-initialized because that makes move checking think that there's a value to destroy even on initialization, causing deinits to run on uninitialized memory. Remove my previous hack, and use a zeroInitializer to initialize the value state when emitting init, which is where we really need the bootstrapping-into-initialized behavior. rdar://113057256

@jckarter
Copy link
Contributor Author

@swift-ci Please test

We can't really treat them as always-initialized because that makes move checking
think that there's a value to destroy even on initialization, causing deinits to
run on uninitialized memory. Remove my previous hack, and use a `zeroInitializer`
to initialize the value state when emitting `init`, which is where we really need
the bootstrapping-into-initialized behavior. rdar://113057256
@jckarter jckarter force-pushed the raw-layout-initialization branch from e264df6 to 9b78356 Compare August 1, 2023 15:34
@jckarter
Copy link
Contributor Author

jckarter commented Aug 1, 2023

@swift-ci Please test

@jckarter jckarter merged commit 984b4f2 into swiftlang:main Aug 1, 2023
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.

1 participant