mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Catch FatalError in CompilerStack::analysis to cover all the analysis tests
This commit is contained in:
parent
d5f40c141b
commit
e8be0e61b3
@ -60,17 +60,7 @@ bool typeSupportedByOldABIEncoder(Type const& _type)
|
|||||||
|
|
||||||
bool TypeChecker::checkTypeRequirements(ASTNode const& _contract)
|
bool TypeChecker::checkTypeRequirements(ASTNode const& _contract)
|
||||||
{
|
{
|
||||||
try
|
_contract.accept(*this);
|
||||||
{
|
|
||||||
_contract.accept(*this);
|
|
||||||
}
|
|
||||||
catch (FatalError const&)
|
|
||||||
{
|
|
||||||
// We got a fatal error which required to stop further type checking, but we can
|
|
||||||
// continue normally from here.
|
|
||||||
if (m_errorReporter.errors().empty())
|
|
||||||
throw; // Something is weird here, rather throw again.
|
|
||||||
}
|
|
||||||
return Error::containsOnlyWarnings(m_errorReporter.errors());
|
return Error::containsOnlyWarnings(m_errorReporter.errors());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -164,6 +164,8 @@ bool CompilerStack::analyze()
|
|||||||
resolveImports();
|
resolveImports();
|
||||||
|
|
||||||
bool noErrors = true;
|
bool noErrors = true;
|
||||||
|
|
||||||
|
try {
|
||||||
SyntaxChecker syntaxChecker(m_errorReporter);
|
SyntaxChecker syntaxChecker(m_errorReporter);
|
||||||
for (Source const* source: m_sourceOrder)
|
for (Source const* source: m_sourceOrder)
|
||||||
if (!syntaxChecker.checkSyntax(*source->ast))
|
if (!syntaxChecker.checkSyntax(*source->ast))
|
||||||
@ -245,6 +247,14 @@ bool CompilerStack::analyze()
|
|||||||
smtChecker.analyze(*source->ast);
|
smtChecker.analyze(*source->ast);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
catch(FatalError const&)
|
||||||
|
{
|
||||||
|
if (m_errorReporter.errors().empty())
|
||||||
|
throw; // Something is weird here, rather throw again.
|
||||||
|
noErrors = false;
|
||||||
|
}
|
||||||
|
|
||||||
if (noErrors)
|
if (noErrors)
|
||||||
{
|
{
|
||||||
m_stackState = AnalysisSuccessful;
|
m_stackState = AnalysisSuccessful;
|
||||||
|
Loading…
Reference in New Issue
Block a user