mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #6593 from ethereum/catchFatalErrorsInAnalysis
[Yul] Catch fatal errors in analysis.
This commit is contained in:
commit
cdf60c3be8
@ -51,12 +51,21 @@ set<string> const builtinTypes{"bool", "u8", "s8", "u32", "s32", "u64", "s64", "
|
|||||||
|
|
||||||
bool AsmAnalyzer::analyze(Block const& _block)
|
bool AsmAnalyzer::analyze(Block const& _block)
|
||||||
{
|
{
|
||||||
if (!(ScopeFiller(m_info, m_errorReporter))(_block))
|
bool success = false;
|
||||||
return false;
|
try
|
||||||
|
{
|
||||||
|
if (!(ScopeFiller(m_info, m_errorReporter))(_block))
|
||||||
|
return false;
|
||||||
|
|
||||||
bool success = (*this)(_block);
|
success = (*this)(_block);
|
||||||
if (!success)
|
if (!success)
|
||||||
solAssert(m_errorReporter.hasErrors(), "No success but no error.");
|
solAssert(m_errorReporter.hasErrors(), "No success but no error.");
|
||||||
|
}
|
||||||
|
catch (FatalError const&)
|
||||||
|
{
|
||||||
|
// This FatalError con occur if the errorReporter has too many errors.
|
||||||
|
solAssert(!m_errorReporter.errors().empty(), "Fatal error detected, but no error is reported.");
|
||||||
|
}
|
||||||
return success && !m_errorReporter.hasErrors();
|
return success && !m_errorReporter.hasErrors();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user