Skip to content

Commit 07610e0

Browse files
committed
Format document
1 parent bf7e3a0 commit 07610e0

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

cpp/ql/src/experimental/Likely Bugs/RedundantNullCheckParam.ql

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,7 @@ predicate blockDominates(Block check, Block access) {
1919
}
2020

2121
predicate isCheckedInstruction(VariableAccess unchecked, VariableAccess checked) {
22-
checked =
23-
any(VariableAccess va |
24-
va.getTarget() = unchecked.getTarget()
25-
) and
22+
checked = any(VariableAccess va | va.getTarget() = unchecked.getTarget()) and
2623
//Simple test if the first access in this code path is dereferenced
2724
not dereferenced(checked) and
2825
blockDominates(checked.getEnclosingBlock(), unchecked.getEnclosingBlock())
@@ -38,7 +35,8 @@ predicate candidateResultChecked(VariableAccess check, EqualityOperation eqop) {
3835
//assert macros are not taken into account
3936
not check.isInMacroExpansion() and
4037
// is part of a comparison against some constant NULL
41-
eqop.getAnOperand() = check and eqop.getAnOperand() instanceof NullValue
38+
eqop.getAnOperand() = check and
39+
eqop.getAnOperand() instanceof NullValue
4240
}
4341

4442
from VariableAccess unchecked, VariableAccess check, EqualityOperation eqop, Parameter param
@@ -54,4 +52,5 @@ where
5452
candidateResultChecked(check, eqop) and
5553
// and which has not been checked before in this code path
5654
candidateResultUnchecked(unchecked)
57-
select check, "This null check is redundant or there is a missing null check before $@ ", unchecked, "where dereferencing happens"
55+
select check, "This null check is redundant or there is a missing null check before $@ ", unchecked,
56+
"where dereferencing happens"

0 commit comments

Comments
 (0)