mirror of
https://github.com/github/codeql.git
synced 2026-04-29 18:55:14 +02:00
C++: The update of a for-loop is ExprInVoidContext
This commit is contained in:
@@ -36,6 +36,8 @@ private predicate exprInVoidContext(Expr e) {
|
||||
exists(CommaExpr c | c.getLeftOperand() = e)
|
||||
or
|
||||
exists(CommaExpr c | c.getRightOperand() = e and c instanceof ExprInVoidContext)
|
||||
or
|
||||
exists(ForStmt for | for.getUpdate() = e)
|
||||
) and
|
||||
not e.getActualType() instanceof VoidType
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user