aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/codegen/ExpressionCompiler.cpp
diff options
context:
space:
mode:
authorchriseth <c@ethdev.com>2015-11-19 00:12:39 +0800
committerchriseth <c@ethdev.com>2015-11-19 00:12:39 +0800
commit0cf8d022ae7d2e2da347347fdc76ba9529149c35 (patch)
tree0193a0e120ed554566e4d11c4af50bce4bf84adb /libsolidity/codegen/ExpressionCompiler.cpp
parentb4e666ccf4fe39b0a1fc909b61daf6dc39e77fc4 (diff)
downloaddexon-solidity-0cf8d022ae7d2e2da347347fdc76ba9529149c35.tar.gz
dexon-solidity-0cf8d022ae7d2e2da347347fdc76ba9529149c35.tar.zst
dexon-solidity-0cf8d022ae7d2e2da347347fdc76ba9529149c35.zip
Addmod and mulmod.
Diffstat (limited to 'libsolidity/codegen/ExpressionCompiler.cpp')
-rw-r--r--libsolidity/codegen/ExpressionCompiler.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/libsolidity/codegen/ExpressionCompiler.cpp b/libsolidity/codegen/ExpressionCompiler.cpp
index 3906a897..0f952f9c 100644
--- a/libsolidity/codegen/ExpressionCompiler.cpp
+++ b/libsolidity/codegen/ExpressionCompiler.cpp
@@ -637,6 +637,20 @@ bool ExpressionCompiler::visit(FunctionCall const& _functionCall)
m_context << eth::Instruction::BLOCKHASH;
break;
}
+ case Location::AddMod:
+ case Location::MulMod:
+ {
+ for (unsigned i = 0; i < 3; i ++)
+ {
+ arguments[2 - i]->accept(*this);
+ utils().convertType(*arguments[2 - i]->annotation().type, IntegerType(256));
+ }
+ if (function.location() == Location::AddMod)
+ m_context << eth::Instruction::ADDMOD;
+ else
+ m_context << eth::Instruction::MULMOD;
+ break;
+ }
case Location::ECRecover:
case Location::SHA256:
case Location::RIPEMD160: