diff options
author | chriseth <chris@ethereum.org> | 2017-10-05 18:16:37 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-05 18:16:37 +0800 |
commit | 11c51de5b95343cd1dfcb83a2ef8da0592464c96 (patch) | |
tree | e3a7bd2bcd9e1fe6fb2ba96c9ac64c38fe3fe72c /libsolidity/codegen | |
parent | 54cf15ac4f479a658d3c069b24df92d068ca1325 (diff) | |
parent | 364b4dea6269debefc0a7eaedbec4a60fbf0e74d (diff) | |
download | dexon-solidity-11c51de5b95343cd1dfcb83a2ef8da0592464c96.tar dexon-solidity-11c51de5b95343cd1dfcb83a2ef8da0592464c96.tar.gz dexon-solidity-11c51de5b95343cd1dfcb83a2ef8da0592464c96.tar.bz2 dexon-solidity-11c51de5b95343cd1dfcb83a2ef8da0592464c96.tar.lz dexon-solidity-11c51de5b95343cd1dfcb83a2ef8da0592464c96.tar.xz dexon-solidity-11c51de5b95343cd1dfcb83a2ef8da0592464c96.tar.zst dexon-solidity-11c51de5b95343cd1dfcb83a2ef8da0592464c96.zip |
Merge pull request #2968 from ethereum/calldataencodedsize
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) { |