Disallowed special case of bytes0 arrays.

This commit is contained in:
chriseth 2015-03-17 18:34:57 +01:00
parent 2cde4f3404
commit 90c519d08f

View File

@ -184,6 +184,8 @@ TypePointer Type::fromArrayTypeName(TypeName& _baseTypeName, Expression* _length
TypePointer baseType = _baseTypeName.toType(); TypePointer baseType = _baseTypeName.toType();
if (!baseType) if (!baseType)
BOOST_THROW_EXCEPTION(_baseTypeName.createTypeError("Invalid type name.")); BOOST_THROW_EXCEPTION(_baseTypeName.createTypeError("Invalid type name."));
if (baseType->getStorageBytes() == 0)
BOOST_THROW_EXCEPTION(_baseTypeName.createTypeError("Illegal base type of storage size zero for array."));
if (_length) if (_length)
{ {
if (!_length->getType()) if (!_length->getType())