Skip to content
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

Panicking while dropping lvalue of assignment #1757

Open
krtab opened this issue Mar 13, 2025 · 0 comments
Open

Panicking while dropping lvalue of assignment #1757

krtab opened this issue Mar 13, 2025 · 0 comments
Labels
A-panic Area: Panics

Comments

@krtab
Copy link

krtab commented Mar 13, 2025

Currently the references states that in *x = v, the value contained in x is first dropped before being replaced by v. If that where strictly the case, if the drop panics and that panic is caught, we could then observe an uninitialized x.

Indeed in practice, the generated clean up code moves v into x when unwinding, but this should likely be documented.

@ehuss ehuss added the A-panic Area: Panics label Mar 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-panic Area: Panics
Projects
None yet
Development

No branches or pull requests

2 participants