From e8be0e61b395c61a836e018861cc3fdec10f6a8a Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Thu, 5 Apr 2018 14:23:36 +0200 Subject: Catch FatalError in CompilerStack::analysis to cover all the analysis tests --- libsolidity/interface/CompilerStack.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'libsolidity/interface') diff --git a/libsolidity/interface/CompilerStack.cpp b/libsolidity/interface/CompilerStack.cpp index eacfca9c..e7cdb742 100644 --- a/libsolidity/interface/CompilerStack.cpp +++ b/libsolidity/interface/CompilerStack.cpp @@ -164,6 +164,8 @@ bool CompilerStack::analyze() resolveImports(); bool noErrors = true; + + try { SyntaxChecker syntaxChecker(m_errorReporter); for (Source const* source: m_sourceOrder) if (!syntaxChecker.checkSyntax(*source->ast)) @@ -245,6 +247,14 @@ bool CompilerStack::analyze() smtChecker.analyze(*source->ast); } + } + catch(FatalError const&) + { + if (m_errorReporter.errors().empty()) + throw; // Something is weird here, rather throw again. + noErrors = false; + } + if (noErrors) { m_stackState = AnalysisSuccessful; -- cgit v1.2.3