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

Local variable coruption in software tasks (async functions) #865

Open
mryndzionek opened this issue Dec 13, 2023 · 1 comment
Open

Local variable coruption in software tasks (async functions) #865

mryndzionek opened this issue Dec 13, 2023 · 1 comment

Comments

@mryndzionek
Copy link

A pseudocode sequence like this, in async functinon, fails on the last assert for some reason:

        let a: f32 = -7.6;
        let b = a.to_bits();

        defmt::assert!(a.to_bits() == b);
        defmt::assert!((a as i32) == -7);
        .
        .
        .
        await;
        .
        .
        defmt::assert!(a.to_bits() == b);
        defmt::assert!((a as i32) == -7);

It seems that after await the cast to i32 gives -8 instead of -7...

@perlindgren
Copy link
Collaborator

Can you make a reproducible example and we can double check.

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