json_sax: assert the invariant of place_container for the static analyzer

Signed-off-by: Niels Lohmann <mail@nlohmann.me>
This commit is contained in:
Niels Lohmann committed 2026-10-24 18:59:10 +02:00
1 parent e30d2aed18
commit 2852427b3f
2 files changed
+4

No files matched your search

@@ -937,6 +937,8 @@ class json_sax_dom_parser : public json_sax_dom_error_state
/// directly if the value was the one too many.
void place_container(const frame& f, frame* enclosing, BasicJsonType&& value, const bool enclosing_is_innermost)
{
// only a container with a slot may have no enclosing container
JSON_ASSERT(f.slot != nullptr || enclosing != nullptr);
if (f.slot != nullptr)
{
*f.slot = std::move(value);