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

Free function yield_ is unsound #14

Closed
jonas-schievink opened this issue Aug 31, 2019 · 2 comments
Closed

Free function yield_ is unsound #14

jonas-schievink opened this issue Aug 31, 2019 · 2 comments

Comments

@jonas-schievink
Copy link

jonas-schievink commented Aug 31, 2019

It can be used to transmute types. Example causing a segmentation fault (at least on my machine):

use generator::*;

fn main() {
    let g = Gn::new_scoped(|_| {
        yield_::<String, _>(());
    });

    for () in g {}
}
@Xudong-Huang
Copy link
Owner

yied_ should be deprecated. we should always use scoped version's yield method.

@Xudong-Huang
Copy link
Owner

now if call deprecated yield_ in a scoped generator, this will trigger assertion panic.

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

No branches or pull requests

2 participants