mirror of
https://github.com/nlohmann/json.git
synced 2026-10-25 07:18:55 +00:00
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:
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);
|
||||
|
||||
Reference in new issue
Block a user