aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/analysis/ReferencesResolver.cpp
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2018-02-15 18:30:32 +0800
committerchriseth <chris@ethereum.org>2018-02-27 19:17:25 +0800
commit88a5c66f4a7efae6d78ce2e04144219656bb9da0 (patch)
treea2aaf6ea3dd359077ad3024b5938a061c665f439 /libsolidity/analysis/ReferencesResolver.cpp
parent6b9dda06f3d85344a70efb2f868760a0dde9dc45 (diff)
downloaddexon-solidity-88a5c66f4a7efae6d78ce2e04144219656bb9da0.tar.gz
dexon-solidity-88a5c66f4a7efae6d78ce2e04144219656bb9da0.tar.zst
dexon-solidity-88a5c66f4a7efae6d78ce2e04144219656bb9da0.zip
Only active variables at the point of their declaration.
Diffstat (limited to 'libsolidity/analysis/ReferencesResolver.cpp')
-rw-r--r--libsolidity/analysis/ReferencesResolver.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/libsolidity/analysis/ReferencesResolver.cpp b/libsolidity/analysis/ReferencesResolver.cpp
index 4d919f2b..985c44d0 100644
--- a/libsolidity/analysis/ReferencesResolver.cpp
+++ b/libsolidity/analysis/ReferencesResolver.cpp
@@ -83,6 +83,16 @@ void ReferencesResolver::endVisit(ForStatement const& _for)
m_resolver.setScope(_for.scope());
}
+void ReferencesResolver::endVisit(VariableDeclarationStatement const& _varDeclStatement)
+{
+ if (!m_resolveInsideCode)
+ return;
+ if (m_experimental050Mode)
+ for (auto const& var: _varDeclStatement.declarations())
+ if (var)
+ m_resolver.activateVariable(var->name());
+}
+
bool ReferencesResolver::visit(Identifier const& _identifier)
{
auto declarations = m_resolver.nameFromCurrentScope(_identifier.name());