diff options
author | chriseth <c@ethdev.com> | 2015-03-06 22:42:49 +0800 |
---|---|---|
committer | chriseth <c@ethdev.com> | 2015-03-06 22:42:49 +0800 |
commit | 6fea41abd8db5b60c8c42d98db234c038e577a49 (patch) | |
tree | 0ec924ae185a546dfd8f799927a3fa9c2fbfc54d /Types.cpp | |
parent | 28e88903dc7e503e6bf5981f08a56136b860927b (diff) | |
parent | 8de5ff5c25c812512fe46ecb7bbe8a219f4a6b2a (diff) | |
download | dexon-solidity-6fea41abd8db5b60c8c42d98db234c038e577a49.tar.gz dexon-solidity-6fea41abd8db5b60c8c42d98db234c038e577a49.tar.zst dexon-solidity-6fea41abd8db5b60c8c42d98db234c038e577a49.zip |
Merge pull request #1222 from chriseth/sol_copyFromCalldata
Copying between calldata and storage.
Diffstat (limited to 'Types.cpp')
-rw-r--r-- | Types.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -589,11 +589,12 @@ bool ArrayType::operator==(Type const& _other) const return isDynamicallySized() || getLength() == other.getLength(); } -unsigned ArrayType::getCalldataEncodedSize() const +unsigned ArrayType::getCalldataEncodedSize(bool _padded) const { if (isDynamicallySized()) return 0; - bigint size = bigint(getLength()) * (isByteArray() ? 1 : getBaseType()->getCalldataEncodedSize()); + bigint size = bigint(getLength()) * (isByteArray() ? 1 : getBaseType()->getCalldataEncodedSize(_padded)); + size = ((size + 31) / 32) * 32; solAssert(size <= numeric_limits<unsigned>::max(), "Array size does not fit unsigned."); return unsigned(size); } |