diff options
author | Alex Beregszaszi <alex@rtfs.hu> | 2016-11-30 06:04:51 +0800 |
---|---|---|
committer | Alex Beregszaszi <alex@rtfs.hu> | 2016-11-30 06:04:51 +0800 |
commit | d82eac3fed6547ddcaac8ecccb15c7f7eaa74d16 (patch) | |
tree | 3cbd54aac0a1c6b530630be0967d2eeb3ba18669 /liblll | |
parent | 25c5dd48deae72fc3afc1514271f668f04b6c5a4 (diff) | |
download | dexon-solidity-d82eac3fed6547ddcaac8ecccb15c7f7eaa74d16.tar.gz dexon-solidity-d82eac3fed6547ddcaac8ecccb15c7f7eaa74d16.tar.zst dexon-solidity-d82eac3fed6547ddcaac8ecccb15c7f7eaa74d16.zip |
LLL: parseLLL to be less greedy catching exceptions
Diffstat (limited to 'liblll')
-rw-r--r-- | liblll/Compiler.cpp | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/liblll/Compiler.cpp b/liblll/Compiler.cpp index 0cec7bc8..73a82a35 100644 --- a/liblll/Compiler.cpp +++ b/liblll/Compiler.cpp @@ -99,15 +99,28 @@ std::string dev::eth::compileLLLToAsm(std::string const& _src, bool _opt, std::v string dev::eth::parseLLL(string const& _src) { + bool failed = false; + sp::utree o; + try { - sp::utree o; parseTreeLLL(_src, o); - ostringstream ret; - debugOutAST(ret, o); - killBigints(o); + } + catch (...) + { + failed = true; + } + + ostringstream ret; + debugOutAST(ret, o); + killBigints(o); + + if (failed) + { + return string(); + } + else + { return ret.str(); } - catch (...) {} - return string(); } |