github / github/codeql

CPP: Some guard questions about control

Offen
#10,568 4 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
question
Vorherrschende Sprache
CodeQL
Sterne
10.1k
Forks
2.1k
Ø Merge
2 T. 15 Std.
Gemergte PRs (30 T.)
141

Beschreibung

Hi!
I want to detect if there is a check for NULL return value of a function.And I want to get the block which is controlled by `ret == NULL`
So Do I have to consider the following four cases?
```
if(ret == NULL) //comparesEq(ret, null, 0, true, true))
if(ret != NULL) //comparesEq(ret, null, 0, false, true)
if(ret) // I don't know yet how to write this
if(!ret) //I don't know yet how to write this
```
Or Is there a method that includes the above four cases?

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

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