-
Notifications
You must be signed in to change notification settings - Fork 5.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
Make addmod and mulmod revert if the last argument is zero. #3523
Conversation
023fb72
to
c3907ab
Compare
arguments[2]->accept(*this); | ||
utils().convertType(*arguments[2]->annotation().type, IntegerType(256)); | ||
m_context << Instruction::DUP1 << Instruction::ISZERO; | ||
m_context.appendConditionalRevert(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be revert or assert?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah you are right!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
c3907ab
to
88eb269
Compare
Changelog.md
Outdated
@@ -1,6 +1,7 @@ | |||
### 0.4.21 (unreleased) | |||
|
|||
Features: | |||
* Code Generator: Make ``molmod(a, b, 0)`` and ``addmod(a, b, 0)`` revert as experimental 0.5.0 feature. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to update all the documentation changes from revert
to throw (or whatever wording we're using).
88eb269
to
2b5a5a8
Compare
Fixes #2694