diff options
author | Alex Beregszaszi <alex@rtfs.hu> | 2017-06-15 20:02:05 +0800 |
---|---|---|
committer | Alex Beregszaszi <alex@rtfs.hu> | 2017-07-03 06:40:51 +0800 |
commit | d2612655956f88938faba30bd00c9531a69142b4 (patch) | |
tree | b4aa09a54afbf2760cd397be8a14990871b77b57 /libsolidity/codegen/LValue.cpp | |
parent | 68b0ac4fdd86b02d9a12c762b5cf57d5873da82a (diff) | |
download | dexon-solidity-d2612655956f88938faba30bd00c9531a69142b4.tar.gz dexon-solidity-d2612655956f88938faba30bd00c9531a69142b4.tar.zst dexon-solidity-d2612655956f88938faba30bd00c9531a69142b4.zip |
Use shift helper in LValue
Diffstat (limited to 'libsolidity/codegen/LValue.cpp')
-rw-r--r-- | libsolidity/codegen/LValue.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/libsolidity/codegen/LValue.cpp b/libsolidity/codegen/LValue.cpp index a74a3d74..e19cf41e 100644 --- a/libsolidity/codegen/LValue.cpp +++ b/libsolidity/codegen/LValue.cpp @@ -186,7 +186,7 @@ void StorageItem::retrieveValue(SourceLocation const&, bool _remove) const solUnimplemented("Not yet implemented - FixedPointType."); if (m_dataType->category() == Type::Category::FixedBytes) { - m_context << (u256(0x1) << (256 - 8 * m_dataType->storageBytes())) << Instruction::MUL; + CompilerUtils(m_context).leftShiftNumberOnStack(256 - 8 * m_dataType->storageBytes()); cleaned = true; } else if ( @@ -267,9 +267,7 @@ void StorageItem::storeValue(Type const& _sourceType, SourceLocation const& _loc else if (m_dataType->category() == Type::Category::FixedBytes) { solAssert(_sourceType.category() == Type::Category::FixedBytes, "source not fixed bytes"); - m_context - << (u256(0x1) << (256 - 8 * dynamic_cast<FixedBytesType const&>(*m_dataType).numBytes())) - << Instruction::SWAP1 << Instruction::DIV; + CompilerUtils(m_context).rightShiftNumberOnStack(256 - 8 * dynamic_cast<FixedBytesType const&>(*m_dataType).numBytes(), false); } else { |