facebook / facebook/infer

UNINITIALIZED_VALUE false positive in rax

Offen
#1,317 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
false-positive
Vorherrschende Sprache
OCaml
Sterne
15.7k
Forks
2.1k
Ø Merge
19 Std. 36 Min.
Gemergte PRs (30 T.)
13

Beschreibung

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.

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.