Merge pull request #2968 from ethereum/calldataencodedsize

Add some asserts about calldata encoded size.
This commit is contained in:
chriseth 2017-10-05 12:16:37 +02:00 committed by GitHub
commit 11c51de5b9

View File

@ -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)
{