aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/analysis/ReferencesResolver.cpp
diff options
context:
space:
mode:
authorwbt <wbt@users.noreply.github.com>2018-01-23 22:44:37 +0800
committerGitHub <noreply@github.com>2018-01-23 22:44:37 +0800
commit761eae2499b172334e5ea3e75573af99fae2a975 (patch)
tree3ec324015e8d97e9b7ca43cb4dcc3c46b1b3bf31 /libsolidity/analysis/ReferencesResolver.cpp
parent7c69d88f937324b64ed8825f9e611e417421434b (diff)
parente5def2da3d9b6cffbff42e2c9e1941831d2fe5ea (diff)
downloaddexon-solidity-761eae2499b172334e5ea3e75573af99fae2a975.tar
dexon-solidity-761eae2499b172334e5ea3e75573af99fae2a975.tar.gz
dexon-solidity-761eae2499b172334e5ea3e75573af99fae2a975.tar.bz2
dexon-solidity-761eae2499b172334e5ea3e75573af99fae2a975.tar.lz
dexon-solidity-761eae2499b172334e5ea3e75573af99fae2a975.tar.xz
dexon-solidity-761eae2499b172334e5ea3e75573af99fae2a975.tar.zst
dexon-solidity-761eae2499b172334e5ea3e75573af99fae2a975.zip
Update from official repo
Diffstat (limited to 'libsolidity/analysis/ReferencesResolver.cpp')
-rw-r--r--libsolidity/analysis/ReferencesResolver.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/libsolidity/analysis/ReferencesResolver.cpp b/libsolidity/analysis/ReferencesResolver.cpp
index f22c95cc..540ffaf5 100644
--- a/libsolidity/analysis/ReferencesResolver.cpp
+++ b/libsolidity/analysis/ReferencesResolver.cpp
@@ -146,11 +146,12 @@ 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())
{
- if (!length->annotation().type)
- ConstantEvaluator e(*length, m_errorReporter);
- auto const* lengthType = dynamic_cast<RationalNumberType const*>(length->annotation().type.get());
+ TypePointer lengthTypeGeneric = length->annotation().type;
+ 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.");
+ fatalTypeError(length->location(), "Invalid array length, expected integer literal or constant expression.");
else if (lengthType->isFractional())
fatalTypeError(length->location(), "Array with fractional length specified.");
else if (lengthType->isNegative())
@@ -206,7 +207,7 @@ bool ReferencesResolver::visit(InlineAssembly const& _inlineAssembly)
// Will be re-generated later with correct information
assembly::AsmAnalysisInfo analysisInfo;
- assembly::AsmAnalyzer(analysisInfo, errorsIgnored, false, resolver).analyze(_inlineAssembly.operations());
+ assembly::AsmAnalyzer(analysisInfo, errorsIgnored, assembly::AsmFlavour::Loose, resolver).analyze(_inlineAssembly.operations());
return false;
}