From b1741b7735fea0f0ee8169bf8e48057bbdaf489d Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Mon, 18 Sep 2017 11:09:20 +0100 Subject: Validate array length in type checker --- libsolidity/analysis/ReferencesResolver.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libsolidity/analysis') diff --git a/libsolidity/analysis/ReferencesResolver.cpp b/libsolidity/analysis/ReferencesResolver.cpp index 8f07d43a..a7fa908d 100644 --- a/libsolidity/analysis/ReferencesResolver.cpp +++ b/libsolidity/analysis/ReferencesResolver.cpp @@ -149,7 +149,7 @@ void ReferencesResolver::endVisit(ArrayTypeName const& _typeName) if (!length->annotation().type) ConstantEvaluator e(*length); auto const* lengthType = dynamic_cast(length->annotation().type.get()); - if (!lengthType || lengthType->isFractional()) + if (!lengthType || lengthType->isFractional() || !lengthType->mobileType()) fatalTypeError(length->location(), "Invalid array length, expected integer literal."); else if (lengthType->isNegative()) fatalTypeError(length->location(), "Array with negative length specified."); -- cgit