diff --git a/include/nlohmann/detail/view/materialize.hpp b/include/nlohmann/detail/view/materialize.hpp index 006bdd0f3..62adb30a9 100644 --- a/include/nlohmann/detail/view/materialize.hpp +++ b/include/nlohmann/detail/view/materialize.hpp @@ -143,6 +143,8 @@ BasicJsonType materialize(const document_data& d, const node* n) case value_t::binary: case value_t::discarded: default: + // false positive: the parser's frame stack points into its own storage (never null) + // @infer-ignore NULLPTR_DEREFERENCE sax.null(); break; } diff --git a/single_include/nlohmann/json_view.hpp b/single_include/nlohmann/json_view.hpp index 1e2f8f64c..6de8ee77d 100644 --- a/single_include/nlohmann/json_view.hpp +++ b/single_include/nlohmann/json_view.hpp @@ -6152,6 +6152,8 @@ BasicJsonType materialize(const document_data& d, const node* n) case value_t::binary: case value_t::discarded: default: + // false positive: the parser's frame stack points into its own storage (never null) + // @infer-ignore NULLPTR_DEREFERENCE sax.null(); break; }