Merge pull request #9527 from a3d4/improve-error-coverage-zero-base

Use assert to check zero size base type
This commit is contained in:
chriseth 2020-07-28 21:11:02 +02:00 committed by GitHub
commit b5964a9328
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -243,12 +243,7 @@ void DeclarationTypeChecker::endVisit(ArrayTypeName const& _typeName)
solAssert(!m_errorReporter.errors().empty(), "");
return;
}
if (baseType->storageBytes() == 0)
m_errorReporter.fatalTypeError(
6493_error,
_typeName.baseType().location(),
"Illegal base type of storage size zero for array."
);
solAssert(baseType->storageBytes() != 0, "Illegal base type of storage size zero for array.");
if (Expression const* length = _typeName.length())
{
TypePointer& lengthTypeGeneric = length->annotation().type;