-
-
Notifications
You must be signed in to change notification settings - Fork 810
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
Overflow checking for unary operators #1636
Labels
bug
Bug that shouldn't change language semantics when fixed.
Comments
Good catch! |
Overflows also happen for uint256, although it is questionable whether using negation on an unsigned value should be allowed at all. |
should not be allowed, yes |
fubuloubu
added a commit
to fubuloubu/vyper
that referenced
this issue
Oct 17, 2019
- Also rejects unary sub on unsigned integers fixes: vyperlang#1636
fubuloubu
added a commit
to fubuloubu/vyper
that referenced
this issue
Oct 17, 2019
- Also rejects unary sub on unsigned integers fixes: vyperlang#1636
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Version Information
What's your issue about?
The unary negation operator does not check for overflows:
This is OK for all inputs except -2^127, for which it returns -2^127 instead of reverting.
The text was updated successfully, but these errors were encountered: