mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Fix scoping following try/catch.
This commit is contained in:
@@ -67,6 +67,22 @@ void ReferencesResolver::endVisit(Block const& _block)
|
||||
m_resolver.setScope(_block.scope());
|
||||
}
|
||||
|
||||
bool ReferencesResolver::visit(TryCatchClause const& _tryCatchClause)
|
||||
{
|
||||
if (!m_resolveInsideCode)
|
||||
return false;
|
||||
m_resolver.setScope(&_tryCatchClause);
|
||||
return true;
|
||||
}
|
||||
|
||||
void ReferencesResolver::endVisit(TryCatchClause const& _tryCatchClause)
|
||||
{
|
||||
if (!m_resolveInsideCode)
|
||||
return;
|
||||
|
||||
m_resolver.setScope(_tryCatchClause.scope());
|
||||
}
|
||||
|
||||
bool ReferencesResolver::visit(ForStatement const& _for)
|
||||
{
|
||||
if (!m_resolveInsideCode)
|
||||
|
||||
@@ -70,6 +70,8 @@ private:
|
||||
|
||||
bool visit(Block const& _block) override;
|
||||
void endVisit(Block const& _block) override;
|
||||
bool visit(TryCatchClause const& _tryCatchClause) override;
|
||||
void endVisit(TryCatchClause const& _tryCatchClause) override;
|
||||
bool visit(ForStatement const& _for) override;
|
||||
void endVisit(ForStatement const& _for) override;
|
||||
void endVisit(VariableDeclarationStatement const& _varDeclStatement) override;
|
||||
|
||||
Reference in New Issue
Block a user