Prevent too deep recursion in parser.

This commit is contained in:
chriseth
2017-08-14 22:19:15 +02:00
parent bcce31b548
commit 32e43477c3
4 changed files with 95 additions and 0 deletions
+12
View File
@@ -1387,6 +1387,18 @@ BOOST_AUTO_TEST_CASE(recursion_depth3)
CHECK_PARSE_ERROR(text, "Maximum recursion depth reached during parsing");
}
BOOST_AUTO_TEST_CASE(recursion_depth4)
{
string text("contract C { function f() { uint a;");
for (size_t i = 0; i < 30000; i++)
text += "(";
text += "a";
for (size_t i = 0; i < 30000; i++)
text += "++)";
text += "}}";
CHECK_PARSE_ERROR(text, "Maximum recursion depth reached during parsing");
}
BOOST_AUTO_TEST_CASE(declaring_fixed_and_ufixed_variables)
{
char const* text = R"(