Skip to content
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

Exception on underflow in subtraction between two signed numbers #1171

Closed
pirapira opened this issue Oct 6, 2016 · 1 comment
Closed

Exception on underflow in subtraction between two signed numbers #1171

pirapira opened this issue Oct 6, 2016 · 1 comment

Comments

@pirapira
Copy link
Member

pirapira commented Oct 6, 2016

Since #796 we are in the process of adding runtime overflow checks. At 3f833c9, solc does not add runtime checks for underflows during subtraction between two signed numbers. This can be seen as follows

$ solc/solc test.sol --opcodes --optimize | grep CALLDATA
<snip> PUSH1 0x24 CALLDATALOAD PUSH1 0x4 CALLDATALOAD SUB PUSH1 0x60 SWAP1 DUP2 MSTORE PUSH1 0x20 SWAP1 RETURN 
@pirapira
Copy link
Member Author

Delegated back to #796.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant