diff options
author | Alex Beregszaszi <alex@rtfs.hu> | 2017-05-07 00:47:08 +0800 |
---|---|---|
committer | Alex Beregszaszi <alex@rtfs.hu> | 2017-05-11 15:02:03 +0800 |
commit | 5b4b620d8b2a36f5e76ffbca16a2d3d5d7253c45 (patch) | |
tree | 2033099277a2c898cfd9d21dd0d195ea49e5605a /libsolidity/interface/CompilerStack.cpp | |
parent | a6586f75044fe24c3bf25761adaec3275060dda5 (diff) | |
download | dexon-solidity-5b4b620d8b2a36f5e76ffbca16a2d3d5d7253c45.tar.gz dexon-solidity-5b4b620d8b2a36f5e76ffbca16a2d3d5d7253c45.tar.zst dexon-solidity-5b4b620d8b2a36f5e76ffbca16a2d3d5d7253c45.zip |
Do not crash on AST if parsing failed
Diffstat (limited to 'libsolidity/interface/CompilerStack.cpp')
-rw-r--r-- | libsolidity/interface/CompilerStack.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libsolidity/interface/CompilerStack.cpp b/libsolidity/interface/CompilerStack.cpp index 9c9c9614..c4e60fd7 100644 --- a/libsolidity/interface/CompilerStack.cpp +++ b/libsolidity/interface/CompilerStack.cpp @@ -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; } |