diff options
author | chriseth <chris@ethereum.org> | 2017-09-27 00:25:36 +0800 |
---|---|---|
committer | chriseth <chris@ethereum.org> | 2017-10-04 19:19:57 +0800 |
commit | 364b4dea6269debefc0a7eaedbec4a60fbf0e74d (patch) | |
tree | cdf991b09eaedaa1c33bc507fa3fd1d56ab368ca /libsolidity/codegen | |
parent | eb5a6aacd993e3782eaf0c0f9dbce03a0567512f (diff) | |
download | dexon-solidity-364b4dea6269debefc0a7eaedbec4a60fbf0e74d.tar dexon-solidity-364b4dea6269debefc0a7eaedbec4a60fbf0e74d.tar.gz dexon-solidity-364b4dea6269debefc0a7eaedbec4a60fbf0e74d.tar.bz2 dexon-solidity-364b4dea6269debefc0a7eaedbec4a60fbf0e74d.tar.lz dexon-solidity-364b4dea6269debefc0a7eaedbec4a60fbf0e74d.tar.xz dexon-solidity-364b4dea6269debefc0a7eaedbec4a60fbf0e74d.tar.zst dexon-solidity-364b4dea6269debefc0a7eaedbec4a60fbf0e74d.zip |
Add some asserts about calldata encoded size.
Diffstat (limited to 'libsolidity/codegen')
-rw-r--r-- | libsolidity/codegen/ArrayUtils.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libsolidity/codegen/ArrayUtils.cpp b/libsolidity/codegen/ArrayUtils.cpp index e17188c2..ce8cbb5f 100644 --- a/libsolidity/codegen/ArrayUtils.cpp +++ b/libsolidity/codegen/ArrayUtils.cpp @@ -291,8 +291,11 @@ void ArrayUtils::copyArrayToMemory(ArrayType const& _sourceType, bool _padToWord CompilerUtils utils(m_context); unsigned baseSize = 1; if (!_sourceType.isByteArray()) + { // We always pad the elements, regardless of _padToWordBoundaries. baseSize = _sourceType.baseType()->calldataEncodedSize(); + solAssert(baseSize >= 0x20, ""); + } if (_sourceType.location() == DataLocation::CallData) { |