aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/codegen/ExpressionCompiler.cpp
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2016-11-21 20:23:51 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2017-07-03 06:37:47 +0800
commitc7ae042114e50ceccd2c230abf80ac7b246d0a44 (patch)
treea0fc11e16ac9ff52733d4a65b14a61ac0bfb1619 /libsolidity/codegen/ExpressionCompiler.cpp
parent0494fa98c0c973bf9e8b3dfa4873e1b5744e7715 (diff)
downloaddexon-solidity-c7ae042114e50ceccd2c230abf80ac7b246d0a44.tar.gz
dexon-solidity-c7ae042114e50ceccd2c230abf80ac7b246d0a44.tar.zst
dexon-solidity-c7ae042114e50ceccd2c230abf80ac7b246d0a44.zip
Use shift helper
Diffstat (limited to 'libsolidity/codegen/ExpressionCompiler.cpp')
-rw-r--r--libsolidity/codegen/ExpressionCompiler.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/libsolidity/codegen/ExpressionCompiler.cpp b/libsolidity/codegen/ExpressionCompiler.cpp
index 9d4024c9..d3586443 100644
--- a/libsolidity/codegen/ExpressionCompiler.cpp
+++ b/libsolidity/codegen/ExpressionCompiler.cpp
@@ -526,7 +526,7 @@ bool ExpressionCompiler::visit(FunctionCall const& _functionCall)
if (m_context.runtimeContext())
// We have a runtime context, so we need the creation part.
- m_context << (u256(1) << 32) << Instruction::SWAP1 << Instruction::DIV;
+ utils().rightShiftNumberOnStack(u256(1) << 32, false);
else
// Extract the runtime part.
m_context << ((u256(1) << 32) - 1) << Instruction::AND;
@@ -1269,7 +1269,7 @@ bool ExpressionCompiler::visit(IndexAccess const& _indexAccess)
m_context.appendConditionalInvalid();
m_context << Instruction::BYTE;
- m_context << (u256(1) << (256 - 8)) << Instruction::MUL;
+ utils().leftShiftNumberOnStack(u256(1) << (256 - 8));
}
else if (baseType.category() == Type::Category::TypeType)
{