aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/codegen/LValue.cpp
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2017-07-03 17:25:04 +0800
committerGitHub <noreply@github.com>2017-07-03 17:25:04 +0800
commit0c7530a8529c5cb45e1b349dc700923b2e685dfc (patch)
tree39ef837613d1362574a890d92db035df0b00573d /libsolidity/codegen/LValue.cpp
parentd230048dc8385744203528115aa9bb5c0fba4339 (diff)
parent677700d5ac1c5079aa20a6a9e5667c7e8596da27 (diff)
downloaddexon-solidity-0c7530a8529c5cb45e1b349dc700923b2e685dfc.tar
dexon-solidity-0c7530a8529c5cb45e1b349dc700923b2e685dfc.tar.gz
dexon-solidity-0c7530a8529c5cb45e1b349dc700923b2e685dfc.tar.bz2
dexon-solidity-0c7530a8529c5cb45e1b349dc700923b2e685dfc.tar.lz
dexon-solidity-0c7530a8529c5cb45e1b349dc700923b2e685dfc.tar.xz
dexon-solidity-0c7530a8529c5cb45e1b349dc700923b2e685dfc.tar.zst
dexon-solidity-0c7530a8529c5cb45e1b349dc700923b2e685dfc.zip
Merge pull request #2499 from ethereum/shift-helper
Add shift helper to CompilerUtils
Diffstat (limited to 'libsolidity/codegen/LValue.cpp')
-rw-r--r--libsolidity/codegen/LValue.cpp6
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
{