aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/analysis
diff options
context:
space:
mode:
authorErik Kundt <bitshift@posteo.org>2018-09-26 18:46:08 +0800
committerErik Kundt <bitshift@posteo.org>2018-09-26 18:46:08 +0800
commit466e8f56e6fa7d816cc28028871b43f3a52fcdaa (patch)
tree3d894cfed7f7d68cfbc29548414dfec2c7327101 /libsolidity/analysis
parente6d87e54c8cdf7c9111707770e995b486ec82460 (diff)
downloaddexon-solidity-466e8f56e6fa7d816cc28028871b43f3a52fcdaa.tar.gz
dexon-solidity-466e8f56e6fa7d816cc28028871b43f3a52fcdaa.tar.zst
dexon-solidity-466e8f56e6fa7d816cc28028871b43f3a52fcdaa.zip
Removes unnecessary check of array type.
Diffstat (limited to 'libsolidity/analysis')
-rw-r--r--libsolidity/analysis/ReferencesResolver.cpp4
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.");