aboutsummaryrefslogtreecommitdiffstats
path: root/Types.cpp
diff options
context:
space:
mode:
authorchriseth <c@ethdev.com>2015-03-06 22:42:49 +0800
committerchriseth <c@ethdev.com>2015-03-06 22:42:49 +0800
commit6fea41abd8db5b60c8c42d98db234c038e577a49 (patch)
tree0ec924ae185a546dfd8f799927a3fa9c2fbfc54d /Types.cpp
parent28e88903dc7e503e6bf5981f08a56136b860927b (diff)
parent8de5ff5c25c812512fe46ecb7bbe8a219f4a6b2a (diff)
downloaddexon-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.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/Types.cpp b/Types.cpp
index 0b8259bf..454d79d9 100644
--- a/Types.cpp
+++ b/Types.cpp
@@ -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);
}