aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2017-08-31 22:03:50 +0800
committerchriseth <chris@ethereum.org>2017-09-06 19:52:29 +0800
commit7886c24d4003beb155b6dba119b92d2df7ec0140 (patch)
tree2bda1c793113876c09ca4637c93b140bca4d0de5
parentd6861d909c7dabb6993cfa7a8269f76c613428f7 (diff)
downloaddexon-solidity-7886c24d4003beb155b6dba119b92d2df7ec0140.tar.gz
dexon-solidity-7886c24d4003beb155b6dba119b92d2df7ec0140.tar.zst
dexon-solidity-7886c24d4003beb155b6dba119b92d2df7ec0140.zip
Modifier invocation can be base constructor call
-rw-r--r--libsolidity/analysis/ViewPureChecker.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/libsolidity/analysis/ViewPureChecker.cpp b/libsolidity/analysis/ViewPureChecker.cpp
index 60b07297..55f391b7 100644
--- a/libsolidity/analysis/ViewPureChecker.cpp
+++ b/libsolidity/analysis/ViewPureChecker.cpp
@@ -302,10 +302,12 @@ void ViewPureChecker::endVisit(IndexAccess const& _indexAccess)
void ViewPureChecker::endVisit(ModifierInvocation const& _modifier)
{
solAssert(_modifier.name(), "");
- ModifierDefinition const* mod = dynamic_cast<decltype(mod)>(_modifier.name()->annotation().referencedDeclaration);
- solAssert(mod, "");
- solAssert(m_inferredMutability.count(mod), "");
-
- reportMutability(m_inferredMutability.at(mod), _modifier.location());
+ if (ModifierDefinition const* mod = dynamic_cast<decltype(mod)>(_modifier.name()->annotation().referencedDeclaration))
+ {
+ solAssert(m_inferredMutability.count(mod), "");
+ reportMutability(m_inferredMutability.at(mod), _modifier.location());
+ }
+ else
+ solAssert(dynamic_cast<ContractDefinition const*>(_modifier.name()->annotation().referencedDeclaration), "");
}