Do not crash on AST if parsing failed

This commit is contained in:
Alex Beregszaszi committed 2017-05-11 08:02:03 +01:00
1 parent a6586f7504
commit 5b4b620d8b
1 file changed
+3
+3
View File
@@ -503,6 +503,9 @@ Scanner const& CompilerStack::scanner(string const& _sourceName) const
SourceUnit const& CompilerStack::ast(string const& _sourceName) const
{
if (m_stackState < ParsingSuccessful)
BOOST_THROW_EXCEPTION(CompilerError() << errinfo_comment("Parsing was not successful."));
return *source(_sourceName).ast;
}