diff options
author | Alex Beregszaszi <alex@rtfs.hu> | 2018-04-05 21:14:31 +0800 |
---|---|---|
committer | Alex Beregszaszi <alex@rtfs.hu> | 2018-04-06 19:52:19 +0800 |
commit | 0812d1189ad3d6ba6338ef7dc39aa61005d731e4 (patch) | |
tree | 7c30ea15eb1b4b11941a876e74dcecea37fe0b48 /libsolidity | |
parent | 3730f68d4b856ba66d2ccf117800c4441e204a99 (diff) | |
download | dexon-solidity-0812d1189ad3d6ba6338ef7dc39aa61005d731e4.tar.gz dexon-solidity-0812d1189ad3d6ba6338ef7dc39aa61005d731e4.tar.zst dexon-solidity-0812d1189ad3d6ba6338ef7dc39aa61005d731e4.zip |
Ignore warnings when limited errors to 256
Diffstat (limited to 'libsolidity')
-rw-r--r-- | libsolidity/interface/ErrorReporter.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/libsolidity/interface/ErrorReporter.cpp b/libsolidity/interface/ErrorReporter.cpp index f7260d51..436cb64f 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<Error>(_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<Error>(_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>(Error::Type::Warning); *err << errinfo_comment("There are more than 256 errors. Aborting."); |