Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3183893

Browse files
authored
Merge pull request #2530 from geoffw0/hiddenqueries2
CPP: Speed up nullCheckAssert in InconsistentCheckReturnNull.ql.
2 parents 40de391 + 1d615d3 commit 3183893

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

cpp/ql/src/Likely Bugs/InconsistentCheckReturnNull.ql

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,16 @@ predicate assertInvocation(File f, int line) {
2525
)
2626
}
2727

28-
predicate nullCheckAssert(Expr e, Variable v, Declaration qualifier) {
29-
nullCheckInCondition(e, v, qualifier) and
28+
class InterestingExpr extends Expr {
29+
InterestingExpr() { nullCheckInCondition(this, _, _) }
30+
}
31+
32+
predicate nullCheckAssert(InterestingExpr e, Variable v, Declaration qualifier) {
3033
exists(File f, int i |
31-
e.getLocation().getStartLine() = i and e.getFile() = f and assertInvocation(f, i)
34+
e.getLocation().getStartLine() = i and
35+
e.getFile() = f and
36+
assertInvocation(f, i) and
37+
nullCheckInCondition(e, v, qualifier)
3238
)
3339
}
3440

0 commit comments

Comments
 (0)