aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2017-05-07 00:47:08 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2017-05-11 15:02:03 +0800
commit5b4b620d8b2a36f5e76ffbca16a2d3d5d7253c45 (patch)
tree2033099277a2c898cfd9d21dd0d195ea49e5605a /libsolidity
parenta6586f75044fe24c3bf25761adaec3275060dda5 (diff)
downloaddexon-solidity-5b4b620d8b2a36f5e76ffbca16a2d3d5d7253c45.tar
dexon-solidity-5b4b620d8b2a36f5e76ffbca16a2d3d5d7253c45.tar.gz
dexon-solidity-5b4b620d8b2a36f5e76ffbca16a2d3d5d7253c45.tar.bz2
dexon-solidity-5b4b620d8b2a36f5e76ffbca16a2d3d5d7253c45.tar.lz
dexon-solidity-5b4b620d8b2a36f5e76ffbca16a2d3d5d7253c45.tar.xz
dexon-solidity-5b4b620d8b2a36f5e76ffbca16a2d3d5d7253c45.tar.zst
dexon-solidity-5b4b620d8b2a36f5e76ffbca16a2d3d5d7253c45.zip
Do not crash on AST if parsing failed
Diffstat (limited to 'libsolidity')
-rw-r--r--libsolidity/interface/CompilerStack.cpp3
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;
}