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

control flow not showing up in async functions #112

Open
carolynzech opened this issue Nov 16, 2023 · 0 comments
Open

control flow not showing up in async functions #112

carolynzech opened this issue Nov 16, 2023 · 0 comments
Labels
bug Something isn't working flow-analysis Concerns the PDG construction component

Comments

@carolynzech
Copy link
Contributor

carolynzech commented Nov 16, 2023

Paralegal does not find f’s control flow influence on the g call site when async minimum is the controller, but it does when regular minimum is. Dumped MIR attached.

#[paralegal::marker(a)]
fn f(a: u32) -> Result<u32, &'static str> {
    if a == 7 {
        Ok(a)
    } else {
        Err("invalid number")
    }
}

#[paralegal::marker(b)]
fn g(b: u32) -> u32 {
    b
}

 async fn minimum() -> Result<u32, &'static str> {
     f(7)?;
     Ok(g(7))
}

fn minimum() -> Result<u32, &'static str> {
    f(7)?;
    Ok(g(7))

minimum_async.mir.gv.pdf
minimum_regular.mir.gv.pdf
main.txt

@JustusAdam JustusAdam added flow-analysis Concerns the PDG construction component bug Something isn't working labels Nov 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working flow-analysis Concerns the PDG construction component
Projects
None yet
Development

No branches or pull requests

2 participants