-
Notifications
You must be signed in to change notification settings - Fork 58
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
UInt parsing is too permissive #609
Comments
johnchandlerburnham
added a commit
that referenced
this issue
Feb 24, 2024
- merges previous parse_num and parse_uint into a single parse_numeric - removes bounds check on Num, so that parsing numbers larger than the field will modularly wrap - corrects uint parsing so that we never accidentally parse uints as nums - implements a placeholder syntax for i64 for parsing twos-complement numbers (i.e. -1i64 parses to u64::MAX). In future this syntax should parse to a new literal type - add placeholder parsing for u8, u16, u32, u128, i8, i16, i32, i128 literals so that we correctly error that these have yet to be implemented - adds unit tests to ensure correctness of the above
github-merge-queue bot
pushed a commit
that referenced
this issue
Feb 25, 2024
* new numeric parser, closes #609, #1161, #1169 - merges previous parse_num and parse_uint into a single parse_numeric - removes bounds check on Num, so that parsing numbers larger than the field will modularly wrap - corrects uint parsing so that we never accidentally parse uints as nums - implements a placeholder syntax for i64 for parsing twos-complement numbers (i.e. -1i64 parses to u64::MAX). In future this syntax should parse to a new literal type - add placeholder parsing for u8, u16, u32, u128, i8, i16, i32, i128 literals so that we correctly error that these have yet to be implemented - adds unit tests to ensure correctness of the above * clippy * clippy part II: revenge of the linter * remove unused byte parsers and associated tests * comment out printlns
Closed by #1171 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Parsing of literal
U64
seems to now accept out-of-range values, which it should not. See before and after examples. 'Before' islurkrs
, after islurk
:The same problem exists for
U32
, though seems to also have been inlurkrs
:The text was updated successfully, but these errors were encountered: