Fix crash due to missing type info

This commit is contained in:
Mathias Baumann
2019-02-19 17:28:44 +01:00
parent d9e4a10d5a
commit a63f7ca9df
3 changed files with 10 additions and 1 deletions
+1 -1
View File
@@ -246,7 +246,7 @@ void ReferencesResolver::endVisit(ArrayTypeName const& _typeName)
fatalTypeError(_typeName.baseType().location(), "Illegal base type of storage size zero for array.");
if (Expression const* length = _typeName.length())
{
TypePointer lengthTypeGeneric = length->annotation().type;
TypePointer& lengthTypeGeneric = length->annotation().type;
if (!lengthTypeGeneric)
lengthTypeGeneric = ConstantEvaluator(m_errorReporter).evaluate(*length);
RationalNumberType const* lengthType = dynamic_cast<RationalNumberType const*>(lengthTypeGeneric.get());