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

Make addmod and mulmod revert if the last argument is zero. #3523

Merged
merged 1 commit into from
Feb 15, 2018

Conversation

chriseth
Copy link
Contributor

Fixes #2694

arguments[2]->accept(*this);
utils().convertType(*arguments[2]->annotation().type, IntegerType(256));
m_context << Instruction::DUP1 << Instruction::ISZERO;
m_context.appendConditionalRevert();
Copy link
Member

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?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah you are right!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

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.
Copy link
Member

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).

@chriseth chriseth merged commit f4aa05f into develop Feb 15, 2018
@axic axic deleted the throwMulmod branch February 15, 2018 14:27
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

Successfully merging this pull request may close these issues.

2 participants