mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Ignore warnings when limited errors to 256
This commit is contained in:
parent
3730f68d4b
commit
0812d1189a
@ -61,6 +61,7 @@ void ErrorReporter::warning(
|
||||
|
||||
void ErrorReporter::error(Error::Type _type, SourceLocation const& _location, string const& _description)
|
||||
{
|
||||
if (_type != Error::Type::Warning)
|
||||
abortIfExcessive();
|
||||
|
||||
auto err = make_shared<Error>(_type);
|
||||
@ -73,6 +74,7 @@ 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)
|
||||
{
|
||||
if (_type != Error::Type::Warning)
|
||||
abortIfExcessive();
|
||||
|
||||
auto err = make_shared<Error>(_type);
|
||||
@ -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.");
|
||||
|
Loading…
Reference in New Issue
Block a user