-
Notifications
You must be signed in to change notification settings - Fork 361
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
Fix range check #1309
Fix range check #1309
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, some simplifications and typos. I think we should have more test for this also, see recent issue.
@@ -0,0 +1,67 @@ | |||
{ | |||
"entry_point": "./tests/tests/range_check/assert_lt_u8_constant.zok", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we have a test with a value which is outside the u8 range and check that it fails, or is it handled in some other test for usize inputs?
def main(field a) -> bool { | ||
field p = FIELD_MAX + a; | ||
// we added a = 0 to prevent the condition to be evaluated at compile time | ||
return a < p; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The other tests down below all do assert(condition)
. Do we cover all cases which just use the condition without asserting it, for example returning it? They are handled differently in code generation so they should be also tested separately.
* fix uint range check * update bit cache with correct bits * suggestions * js fmt * clippy * fix range check, add more tests * update changelog * fieldlt improvements * fix tests
Closes #1295 #1329