mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Do not crash on AST if parsing failed
This commit is contained in:
parent
a6586f7504
commit
5b4b620d8b
@ -503,6 +503,9 @@ Scanner const& CompilerStack::scanner(string const& _sourceName) const
|
|||||||
|
|
||||||
SourceUnit const& CompilerStack::ast(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;
|
return *source(_sourceName).ast;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user