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 /Types.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 'Types.cpp')
-rw-r--r-- | Types.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -570,11 +570,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); } |