summaryrefslogtreecommitdiff
path: root/tests/user_feedback.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/user_feedback.cpp')
-rw-r--r--tests/user_feedback.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/user_feedback.cpp b/tests/user_feedback.cpp
index 6cc1fd34c5..aa1f36b1d6 100644
--- a/tests/user_feedback.cpp
+++ b/tests/user_feedback.cpp
@@ -168,6 +168,18 @@ b = []
constexpr auto start = "fl =[ "sv;
memcpy(s.data(), start.data(), start.length());
parsing_should_fail(FILE_LINE_ARGS, std::string_view{ s });
+
+ // deeply nested inline tables should also fail gracefully, not stack overflow
+ {
+ // build: fl = {a={a={a={a=...{a=1}...}}}
+ std::string nested_tables = "fl = ";
+ for (size_t i = 0; i < 2048; i++)
+ nested_tables += "{a=";
+ nested_tables += "1";
+ for (size_t i = 0; i < 2048; i++)
+ nested_tables += "}";
+ parsing_should_fail(FILE_LINE_ARGS, std::string_view{ nested_tables });
+ }
}
SECTION("tomlplusplus/issues/112") // https://github.com/marzer/tomlplusplus/issues/112