-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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 edge cases in code parser and stringifier (found by fuzzing) #7886
Conversation
- that is, a string (not) terminating with a slash.
95d8253
to
ee3b3d9
Compare
It's failing though... Wasn't able to figure out ranges+newlines yet |
That is, very large integers *with* the suffix specified. It was unconditionally converting the value to uint64, but have to check for the validity of that first. Additional check for num_size < 20 fixes it. Such numbers definitely fit into uint64. And this condition fully covers int64, too. gen_check_uint_fits_in_size is not used for uint64 so this is fine.
Parsing/stringifying a macro body would always add two spaces and a newline, but it's supposed to stop changing after one pass.
Excluded the failing commit, will get back to that one later. |
(in another PR; so this one is ready) |
Thanks! Can the PR be named in a way it reflects the impact and no the procedure so it’s more meaningful as a changelog entry in the future? |
The commits are meaningful changelog entries, the PR is indeed arbitrarily grouped by procedure. |
I think Range and newline doesn't need to be supported because |
Alright, then I will not attempt to cover it. Seems consistent with the rest of the language, things like
But still doing it in a separate PR. |
Yes, now I'm actually not sure, probably endless range only makes sense when |
Well then, good that I split out the controversial thing. |
Thank you @oprypin ! |
https://github.com/oprypin/crystal-fuzzing