Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upOverflow checking for unary operators #1636
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 |
- Also rejects unary sub on unsigned integers fixes: vyperlang#1636
- Also rejects unary sub on unsigned integers fixes: vyperlang#1636
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.