Skip to content

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

Merged
chriseth merged 1 commit intodevelopfrom
throwMulmod
Feb 15, 2018
Merged

Make addmod and mulmod revert if the last argument is zero.#3523
chriseth merged 1 commit intodevelopfrom
throwMulmod

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
Contributor

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
Contributor

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
### 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
Contributor

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

Comments