diff options
author | Erik Kundt <bitshift@posteo.org> | 2018-09-26 18:46:08 +0800 |
---|---|---|
committer | Erik Kundt <bitshift@posteo.org> | 2018-09-26 18:46:08 +0800 |
commit | 466e8f56e6fa7d816cc28028871b43f3a52fcdaa (patch) | |
tree | 3d894cfed7f7d68cfbc29548414dfec2c7327101 | |
parent | e6d87e54c8cdf7c9111707770e995b486ec82460 (diff) | |
download | dexon-solidity-466e8f56e6fa7d816cc28028871b43f3a52fcdaa.tar.gz dexon-solidity-466e8f56e6fa7d816cc28028871b43f3a52fcdaa.tar.zst dexon-solidity-466e8f56e6fa7d816cc28028871b43f3a52fcdaa.zip |
Removes unnecessary check of array type.
-rw-r--r-- | libsolidity/analysis/ReferencesResolver.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/libsolidity/analysis/ReferencesResolver.cpp b/libsolidity/analysis/ReferencesResolver.cpp index 6217c5d1..81de3c43 100644 --- a/libsolidity/analysis/ReferencesResolver.cpp +++ b/libsolidity/analysis/ReferencesResolver.cpp @@ -241,14 +241,12 @@ void ReferencesResolver::endVisit(ArrayTypeName const& _typeName) if (Expression const* length = _typeName.length()) { TypePointer lengthTypeGeneric = length->annotation().type; - auto arrayType = dynamic_cast<ArrayType const*>(baseType.get()); - bool isByteOrFixedSizeArray = (arrayType && arrayType->isByteArray()) || !baseType->isDynamicallySized(); if (!lengthTypeGeneric) lengthTypeGeneric = ConstantEvaluator(m_errorReporter).evaluate(*length); RationalNumberType const* lengthType = dynamic_cast<RationalNumberType const*>(lengthTypeGeneric.get()); if (!lengthType || !lengthType->mobileType()) fatalTypeError(length->location(), "Invalid array length, expected integer literal or constant expression."); - else if (lengthType->isZero() && isByteOrFixedSizeArray) + else if (lengthType->isZero()) fatalTypeError(length->location(), "Array with zero length specified."); else if (lengthType->isFractional()) fatalTypeError(length->location(), "Array with fractional length specified."); |