diff options
author | chriseth <c@ethdev.com> | 2015-03-06 01:22:17 +0800 |
---|---|---|
committer | chriseth <c@ethdev.com> | 2015-03-06 20:17:52 +0800 |
commit | d8b156ecbbb4d470ba3432975694585dd5a019e2 (patch) | |
tree | a5ffc773101dcba3b274acc5329c20f6a73aed6b /CompilerUtils.cpp | |
parent | 34e8de749aeecbca5f5dae817aa67f42907e9bf7 (diff) | |
download | dexon-solidity-d8b156ecbbb4d470ba3432975694585dd5a019e2.tar.gz dexon-solidity-d8b156ecbbb4d470ba3432975694585dd5a019e2.tar.zst dexon-solidity-d8b156ecbbb4d470ba3432975694585dd5a019e2.zip |
Copying between calldata and storage.
Diffstat (limited to 'CompilerUtils.cpp')
-rw-r--r-- | CompilerUtils.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/CompilerUtils.cpp b/CompilerUtils.cpp index 7f8f72ca..8a26b5d1 100644 --- a/CompilerUtils.cpp +++ b/CompilerUtils.cpp @@ -92,7 +92,7 @@ void CompilerUtils::storeInMemoryDynamic(Type const& _type, bool _padToWordBound } else { - solAssert(type.getLocation() == ArrayType::Location::Storage, "Memory byte arrays not yet implemented."); + solAssert(type.getLocation() == ArrayType::Location::Storage, "Memory arrays not yet implemented."); m_context << eth::Instruction::DUP1 << eth::Instruction::SLOAD; // stack here: memory_offset storage_offset length_bytes // jump to end if length is zero @@ -177,8 +177,7 @@ void CompilerUtils::computeHashStatic(Type const& _type, bool _padToWordBoundari unsigned CompilerUtils::loadFromMemoryHelper(Type const& _type, bool _fromCalldata, bool _padToWordBoundaries) { - unsigned _encodedSize = _type.getCalldataEncodedSize(); - unsigned numBytes = _padToWordBoundaries ? getPaddedSize(_encodedSize) : _encodedSize; + unsigned numBytes = _type.getCalldataEncodedSize(_padToWordBoundaries); bool leftAligned = _type.getCategory() == Type::Category::String; if (numBytes == 0) m_context << eth::Instruction::POP << u256(0); @@ -202,8 +201,7 @@ unsigned CompilerUtils::loadFromMemoryHelper(Type const& _type, bool _fromCallda unsigned CompilerUtils::prepareMemoryStore(Type const& _type, bool _padToWordBoundaries) const { - unsigned _encodedSize = _type.getCalldataEncodedSize(); - unsigned numBytes = _padToWordBoundaries ? getPaddedSize(_encodedSize) : _encodedSize; + unsigned numBytes = _type.getCalldataEncodedSize(_padToWordBoundaries); bool leftAligned = _type.getCategory() == Type::Category::String; if (numBytes == 0) m_context << eth::Instruction::POP; |