Add some asserts about calldata encoded size.

This commit is contained in:
chriseth 2017-09-26 18:25:36 +02:00
parent eb5a6aacd9
commit 364b4dea62

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