mirror of
https://github.com/github/codeql.git
synced 2026-04-28 10:15:14 +02:00
CPP: Speed up nullCheckAssert in InconsistentCheckReturnNull.ql.
This commit is contained in:
@@ -25,10 +25,14 @@ predicate assertInvocation(File f, int line) {
|
||||
)
|
||||
}
|
||||
|
||||
predicate nullCheckAssert(Expr e, Variable v, Declaration qualifier) {
|
||||
nullCheckInCondition(e, v, qualifier) and
|
||||
class InterestingExpr extends Expr {
|
||||
InterestingExpr() { nullCheckInCondition(this, _, _) }
|
||||
}
|
||||
|
||||
predicate nullCheckAssert(InterestingExpr e, Variable v, Declaration qualifier) {
|
||||
exists(File f, int i |
|
||||
e.getLocation().getStartLine() = i and e.getFile() = f and assertInvocation(f, i)
|
||||
e.getLocation().getStartLine() = i and e.getFile() = f and assertInvocation(f, i) and
|
||||
nullCheckInCondition(e, v, qualifier)
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user