diff --git a/libsolidity/analysis/ReferencesResolver.cpp b/libsolidity/analysis/ReferencesResolver.cpp index 3415dee22..ac3553f6b 100644 --- a/libsolidity/analysis/ReferencesResolver.cpp +++ b/libsolidity/analysis/ReferencesResolver.cpp @@ -44,8 +44,9 @@ namespace solidity::frontend bool ReferencesResolver::resolve(ASTNode const& _root) { + auto errorWatcher = m_errorReporter.errorWatcher(); _root.accept(*this); - return !m_errorOccurred; + return errorWatcher.ok(); } bool ReferencesResolver::visit(Block const& _block) @@ -267,19 +268,16 @@ void ReferencesResolver::operator()(yul::VariableDeclaration const& _varDecl) void ReferencesResolver::declarationError(SourceLocation const& _location, string const& _description) { - m_errorOccurred = true; m_errorReporter.declarationError(8532_error, _location, _description); } void ReferencesResolver::declarationError(SourceLocation const& _location, SecondarySourceLocation const& _ssl, string const& _description) { - m_errorOccurred = true; m_errorReporter.declarationError(3881_error, _location, _ssl, _description); } void ReferencesResolver::fatalDeclarationError(SourceLocation const& _location, string const& _description) { - m_errorOccurred = true; m_errorReporter.fatalDeclarationError(6546_error, _location, _description); } diff --git a/libsolidity/analysis/ReferencesResolver.h b/libsolidity/analysis/ReferencesResolver.h index 2a4daf3db..7b8c1fff5 100644 --- a/libsolidity/analysis/ReferencesResolver.h +++ b/libsolidity/analysis/ReferencesResolver.h @@ -103,7 +103,6 @@ private: /// Stack of return parameters. std::vector m_returnParameters; bool const m_resolveInsideCode; - bool m_errorOccurred = false; InlineAssemblyAnnotation* m_yulAnnotation = nullptr; bool m_yulInsideFunction = false;