Fix segfault with undeclared array types

This commit is contained in:
Federico Bond
2018-02-11 21:40:41 -03:00
parent 2095e7a32d
commit 75a3a707a2
2 changed files with 15 additions and 0 deletions
@@ -153,6 +153,11 @@ void ReferencesResolver::endVisit(Mapping const& _typeName)
void ReferencesResolver::endVisit(ArrayTypeName const& _typeName)
{
TypePointer baseType = _typeName.baseType().annotation().type;
if (!baseType)
{
solAssert(!m_errorReporter.errors().empty(), "");
return;
}
if (baseType->storageBytes() == 0)
fatalTypeError(_typeName.baseType().location(), "Illegal base type of storage size zero for array.");
if (Expression const* length = _typeName.length())