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

Check that SYST.set_reload's argument is valid #511

Open
Ecco opened this issue Feb 2, 2024 · 0 comments
Open

Check that SYST.set_reload's argument is valid #511

Ecco opened this issue Feb 2, 2024 · 0 comments

Comments

@Ecco
Copy link

Ecco commented Feb 2, 2024

The SYST.set_reload takes a number of cycles as an argument. Even though the type of this argument is an u32, only values that fit on 24 bits are valid. The code does document this caveat, however in practice there is no check being enforced.

As a result, it's very easy to pass a value that's too large and that will silently overflow, leading to a hard-to-diagnose incorrect behavior.

Would it make sense to add an assertion about the argument there?

@Ecco Ecco changed the title Assert that SYST.set_reload's argument is valid Check that SYST.set_reload's argument is valid Feb 2, 2024
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

1 participant