Note that the diff frame reference is invalidated by pop_back() too

Signed-off-by: Niels Lohmann <mail@nlohmann.me>
This commit is contained in:
Niels Lohmann
2026-09-26 07:46:43 +02:00
parent b41e43fffc
commit 33c4dfdc18
2 changed files with 4 additions and 0 deletions
+2
View File
@@ -6482,6 +6482,8 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
enter(source, target);
while (!stack.empty())
{
// invalidated when enter() pushes a frame and by the pop_back()
// at the end, so not used after either
diff_frame& frame = stack.back();
const std::size_t path_length = frame.path_length;
const std::size_t depth = stack.size();
+2
View File
@@ -31440,6 +31440,8 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
enter(source, target);
while (!stack.empty())
{
// invalidated when enter() pushes a frame and by the pop_back()
// at the end, so not used after either
diff_frame& frame = stack.back();
const std::size_t path_length = frame.path_length;
const std::size_t depth = stack.size();