diff options
Diffstat (limited to 'test/libsolidity/AnalysisFramework.cpp')
-rw-r--r-- | test/libsolidity/AnalysisFramework.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/test/libsolidity/AnalysisFramework.cpp b/test/libsolidity/AnalysisFramework.cpp index 71bb4ca7..5f5f6411 100644 --- a/test/libsolidity/AnalysisFramework.cpp +++ b/test/libsolidity/AnalysisFramework.cpp @@ -106,12 +106,12 @@ void AnalysisFramework::printErrors() ); } -ContractDefinition const* AnalysisFramework::retrieveContract(SourceUnit const& _source, unsigned index) +ContractDefinition const* AnalysisFramework::retrieveContractByName(SourceUnit const& _source, string const& _name) { ContractDefinition* contract = nullptr; - unsigned counter = 0; + for (shared_ptr<ASTNode> const& node: _source.nodes()) - if ((contract = dynamic_cast<ContractDefinition*>(node.get())) && counter == index) + if ((contract = dynamic_cast<ContractDefinition*>(node.get())) && contract->name() == _name) return contract; return nullptr; |