Mark an Infer false positive in materialize()
Infer 1.3.0 reports NULLPTR_DEREFERENCE because the node pointer can come from navigation<true>::value(), which follows links. A link always has a target in a valid index, so suppress it on that line, as develop does for its own Infer false positives (#5750). Signed-off-by: Niels Lohmann <mail@nlohmann.me>
This commit is contained in:
2 files changed
+4
No files matched your search
@@ -54,6 +54,8 @@ BasicJsonType materialize(const document_data& d, const node* n)
|
|||||||
std::vector<frame> open;
|
std::vector<frame> open;
|
||||||
for (;;)
|
for (;;)
|
||||||
{
|
{
|
||||||
|
// false positive: n comes from nav::value(), which never returns null for a valid index
|
||||||
|
// @infer-ignore NULLPTR_DEREFERENCE
|
||||||
switch (static_cast<value_t>(n->kind))
|
switch (static_cast<value_t>(n->kind))
|
||||||
{
|
{
|
||||||
case value_t::object:
|
case value_t::object:
|
||||||
|
|||||||
@@ -4326,6 +4326,8 @@ BasicJsonType materialize(const document_data& d, const node* n)
|
|||||||
std::vector<frame> open;
|
std::vector<frame> open;
|
||||||
for (;;)
|
for (;;)
|
||||||
{
|
{
|
||||||
|
// false positive: n comes from nav::value(), which never returns null for a valid index
|
||||||
|
// @infer-ignore NULLPTR_DEREFERENCE
|
||||||
switch (static_cast<value_t>(n->kind))
|
switch (static_cast<value_t>(n->kind))
|
||||||
{
|
{
|
||||||
case value_t::object:
|
case value_t::object:
|
||||||
|
|||||||
Reference in new issue
Block a user