mirror of
https://github.com/github/codeql.git
synced 2026-04-27 09:45:15 +02:00
C++: Ignore complex guards and the comma operator
This commit is contained in:
@@ -40,5 +40,7 @@ where
|
||||
strictcount(bb.(BlockStmt).getAStmt()) = 1
|
||||
) and
|
||||
strictcount(BasicBlock bb2 | gc.ensuresEq(_, 0, bb2, _) | bb2) = 1 and
|
||||
not isAffectedByMacro(fc, bb)
|
||||
not isAffectedByMacro(fc, bb) and
|
||||
not (gc instanceof BinaryOperation and not gc instanceof ComparisonOperation) and
|
||||
not exists(CommaExpr c | c.getAChild*() = fc)
|
||||
select gc, "unnecessary NULL check before call to $@", fc, "free"
|
||||
|
||||
Reference in New Issue
Block a user