facebook / facebook/infer

UNINITIALIZED_VALUE false positive in rax

Ouverte
#1,317 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
false-positive
Langage dominant
OCaml
Étoiles
15.7k
Forks
2.1k
Merge moyen
19 h 36 min
PR mergées (30 j)
13

Description

I'm using Infer version v0.17.0 and it incorrectly reports a `UNINITIALIZED_VALUE` error.

The report from infer complains about [line 1206](https://github.com/antirez/rax/blob/master/rax.c#L1206):
```
rax.c:1206: error: UNINITIALIZED_VALUE
The value read from parent was never initialized.
Showing all 1 steps of the trace

rax.c:1206:17:
1204.
1205. /* Fix parent link. */
1206. > if (parent) {
1207. raxNode **parentlink = raxFindParentLink(parent,start);
1208. memcpy(parentlink,&new,sizeof(new));
```

However, it is definitely initialized by this loop:

https://github.com/antirez/rax/blob/23f31ca89c669841a4dc9dda73fe09aa6f014f28/rax.c#L1144-L1151

If we set parent to NULL in [line 1144](https://github.com/antirez/rax/blob/23f31ca89c669841a4dc9dda73fe09aa6f014f28/rax.c#L1144) the error is gone.

Please clone the repository and run `infer -- make` to reproduce.

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.