diff options
author | chriseth <chris@ethereum.org> | 2018-02-15 18:30:32 +0800 |
---|---|---|
committer | chriseth <chris@ethereum.org> | 2018-02-27 19:17:25 +0800 |
commit | 88a5c66f4a7efae6d78ce2e04144219656bb9da0 (patch) | |
tree | a2aaf6ea3dd359077ad3024b5938a061c665f439 /libsolidity/analysis/ReferencesResolver.cpp | |
parent | 6b9dda06f3d85344a70efb2f868760a0dde9dc45 (diff) | |
download | dexon-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.cpp | 10 |
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()); |