diff options
author | Alex Beregszaszi <alex@rtfs.hu> | 2017-09-18 18:09:20 +0800 |
---|---|---|
committer | Alex Beregszaszi <alex@rtfs.hu> | 2017-09-29 23:44:00 +0800 |
commit | b1741b7735fea0f0ee8169bf8e48057bbdaf489d (patch) | |
tree | 4368cc9ea3c65fed9e55b98bb6b03db80d91a7b0 /libsolidity/analysis | |
parent | f3fe043cc13ac76a7ca02285a54f973a4dc4461d (diff) | |
download | dexon-solidity-b1741b7735fea0f0ee8169bf8e48057bbdaf489d.tar dexon-solidity-b1741b7735fea0f0ee8169bf8e48057bbdaf489d.tar.gz dexon-solidity-b1741b7735fea0f0ee8169bf8e48057bbdaf489d.tar.bz2 dexon-solidity-b1741b7735fea0f0ee8169bf8e48057bbdaf489d.tar.lz dexon-solidity-b1741b7735fea0f0ee8169bf8e48057bbdaf489d.tar.xz dexon-solidity-b1741b7735fea0f0ee8169bf8e48057bbdaf489d.tar.zst dexon-solidity-b1741b7735fea0f0ee8169bf8e48057bbdaf489d.zip |
Validate array length in type checker
Diffstat (limited to 'libsolidity/analysis')
-rw-r--r-- | libsolidity/analysis/ReferencesResolver.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
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<RationalNumberType const*>(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."); |