Box syntax and generator_clone
can lead to double free
#105084
Labels
A-coroutines
Area: Coroutines
C-bug
Category: This is a bug.
F-coroutine_clone
`#![feature(coroutine_clone)]`
F-coroutines
`#![feature(coroutines)]`
I-unsound
Issue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/Soundness
requires-nightly
This issue requires a nightly compiler in some way.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
I tried this code:
Playground
I expected to see this happen: compilation fails.
Instead, this happened: double free
Note: if we do not
resume
the generators after the copy, we get a memory leak.Meta
rustc version: tested on playground nightly on 2022-11-30.
The text was updated successfully, but these errors were encountered: