Add JSON_RECURSION_DEPTH_LIMIT to set how deep value walks recurse (#6081)

Signed-off-by: Niels Lohmann <mail@nlohmann.me>
This commit is contained in:
Niels Lohmann authored and GitHub committed 2026-11-11 22:32:05 +01:00
1 parent 0660d78b9c
commit 1dae5a66b1
30 files changed
+1340 -95

No files matched your search

+4 -2
View File
@@ -1554,8 +1554,10 @@ TEST_CASE("regression tests 1")
SECTION("a missing member of an object")
{
my_json j = make();
#ifdef JSON_NO_THREAD_LOCAL
// (set by the user, or by the library for clang with MinGW)
#if defined(JSON_NO_THREAD_LOCAL) || JSON_RECURSION_DEPTH_LIMIT < 2
// (set by the user, or by the library for clang with MinGW; or fewer than two
// levels are copied by the object type itself, as for a recursion depth limit
// of 0 or 1: the objects below the outermost one are the second level)
// the objects below the outermost one are not copied by their
// object_t here, but member by member, which keeps their
// timestamps correct: "c" is not mistaken for "b" and is inserted