aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2016-11-30 06:04:51 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2016-11-30 06:04:51 +0800
commitd82eac3fed6547ddcaac8ecccb15c7f7eaa74d16 (patch)
tree3cbd54aac0a1c6b530630be0967d2eeb3ba18669
parent25c5dd48deae72fc3afc1514271f668f04b6c5a4 (diff)
downloaddexon-solidity-d82eac3fed6547ddcaac8ecccb15c7f7eaa74d16.tar
dexon-solidity-d82eac3fed6547ddcaac8ecccb15c7f7eaa74d16.tar.gz
dexon-solidity-d82eac3fed6547ddcaac8ecccb15c7f7eaa74d16.tar.bz2
dexon-solidity-d82eac3fed6547ddcaac8ecccb15c7f7eaa74d16.tar.lz
dexon-solidity-d82eac3fed6547ddcaac8ecccb15c7f7eaa74d16.tar.xz
dexon-solidity-d82eac3fed6547ddcaac8ecccb15c7f7eaa74d16.tar.zst
dexon-solidity-d82eac3fed6547ddcaac8ecccb15c7f7eaa74d16.zip
LLL: parseLLL to be less greedy catching exceptions
-rw-r--r--liblll/Compiler.cpp25
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();
}