aboutsummaryrefslogtreecommitdiffstats
path: root/Types.cpp
diff options
context:
space:
mode:
authorchriseth <c@ethdev.com>2015-03-06 01:22:17 +0800
committerchriseth <c@ethdev.com>2015-03-06 20:17:52 +0800
commitd8b156ecbbb4d470ba3432975694585dd5a019e2 (patch)
treea5ffc773101dcba3b274acc5329c20f6a73aed6b /Types.cpp
parent34e8de749aeecbca5f5dae817aa67f42907e9bf7 (diff)
downloaddexon-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.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/Types.cpp b/Types.cpp
index 96feefff..3f044528 100644
--- a/Types.cpp
+++ b/Types.cpp
@@ -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);
}