-
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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 issue #380: Signed integer overflow check #390
Conversation
Previously, |
Off-topic, but I had to compile the latest re2c (0.16) as Fedora 25 only provided 0.14.3, which didn't have the It seems like the new version also reduced the generated code length. EDIT: Now that I look at the generated re2c code again, it seems like the only changes are in minimizing whitespace. |
Or, one could make changes to the .hpp, and then have a pre-commit hook do |
I missed the part about |
There are some conversion warnings. Can you fix them? |
Instead of checking something like `x * y + z > max` where `x * y` can overflow, check for `x > (max - z) / y` instead.
Use static_cast on digit.
Thanks! |
Thanks! I shall add a regression test for |
See issue #380.