@@ -19,10 +19,7 @@ predicate blockDominates(Block check, Block access) {
1919}
2020
2121predicate 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
4442from VariableAccess unchecked , VariableAccess check , EqualityOperation eqop , Parameter param
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