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:
2 files changed
+4
No files matched your search
@@ -6482,6 +6482,8 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
|
|||||||
enter(source, target);
|
enter(source, target);
|
||||||
while (!stack.empty())
|
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();
|
diff_frame& frame = stack.back();
|
||||||
const std::size_t path_length = frame.path_length;
|
const std::size_t path_length = frame.path_length;
|
||||||
const std::size_t depth = stack.size();
|
const std::size_t depth = stack.size();
|
||||||
|
|||||||
@@ -31440,6 +31440,8 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
|
|||||||
enter(source, target);
|
enter(source, target);
|
||||||
while (!stack.empty())
|
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();
|
diff_frame& frame = stack.back();
|
||||||
const std::size_t path_length = frame.path_length;
|
const std::size_t path_length = frame.path_length;
|
||||||
const std::size_t depth = stack.size();
|
const std::size_t depth = stack.size();
|
||||||
|
|||||||
Reference in new issue
Block a user