aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2017-10-05 18:16:37 +0800
committerGitHub <noreply@github.com>2017-10-05 18:16:37 +0800
commit11c51de5b95343cd1dfcb83a2ef8da0592464c96 (patch)
treee3a7bd2bcd9e1fe6fb2ba96c9ac64c38fe3fe72c /libsolidity
parent54cf15ac4f479a658d3c069b24df92d068ca1325 (diff)
parent364b4dea6269debefc0a7eaedbec4a60fbf0e74d (diff)
downloaddexon-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')
-rw-r--r--libsolidity/codegen/ArrayUtils.cpp3
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)
{