You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
The text was updated successfully, but these errors were encountered:
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
The
SYST.set_reload
takes a number of cycles as an argument. Even though the type of this argument is anu32
, 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?
The text was updated successfully, but these errors were encountered: