Skip to content

Commit af2a7ea

Browse files
authored
Reduce false alarms of InconsistentNullnessTesting.ql
We should ignore `checked` in a macro to avoid too many false alarms,
1 parent fb15a4e commit af2a7ea

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

cpp/ql/src/Critical/InconsistentNullnessTesting.ql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ import cpp
1515
from StackVariable v, ControlFlowNode def, VariableAccess checked, VariableAccess unchecked
1616
where
1717
checked = v.getAnAccess() and
18+
// The check can often be in a macro for handling exception
19+
not checked.isInMacroExpansion() and
1820
dereferenced(checked) and
1921
unchecked = v.getAnAccess() and
2022
dereferenced(unchecked) and

0 commit comments

Comments
 (0)