From 0812d1189ad3d6ba6338ef7dc39aa61005d731e4 Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Thu, 5 Apr 2018 15:14:31 +0200 Subject: [PATCH] Ignore warnings when limited errors to 256 --- libsolidity/interface/ErrorReporter.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/libsolidity/interface/ErrorReporter.cpp b/libsolidity/interface/ErrorReporter.cpp index f7260d51d..436cb64fb 100644 --- a/libsolidity/interface/ErrorReporter.cpp +++ b/libsolidity/interface/ErrorReporter.cpp @@ -61,7 +61,8 @@ void ErrorReporter::warning( void ErrorReporter::error(Error::Type _type, SourceLocation const& _location, string const& _description) { - abortIfExcessive(); + if (_type != Error::Type::Warning) + abortIfExcessive(); auto err = make_shared(_type); *err << @@ -73,7 +74,8 @@ void ErrorReporter::error(Error::Type _type, SourceLocation const& _location, st void ErrorReporter::error(Error::Type _type, SourceLocation const& _location, SecondarySourceLocation const& _secondaryLocation, string const& _description) { - abortIfExcessive(); + if (_type != Error::Type::Warning) + abortIfExcessive(); auto err = make_shared(_type); *err << @@ -86,7 +88,12 @@ void ErrorReporter::error(Error::Type _type, SourceLocation const& _location, Se void ErrorReporter::abortIfExcessive() { - if (m_errorList.size() > 256) + unsigned errorCount = 0; + for (auto const& error: m_errorList) + if (error->type() != Error::Type::Warning) + errorCount++; + + if (errorCount > 256) { auto err = make_shared(Error::Type::Warning); *err << errinfo_comment("There are more than 256 errors. Aborting.");