Skip to content

Commit 6c069ff

Browse files
committed
C++: The update of a for-loop is ExprInVoidContext
1 parent edc9e23 commit 6c069ff

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

cpp/ql/src/semmle/code/cpp/commons/VoidContext.qll

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ private predicate exprInVoidContext(Expr e) {
3636
exists(CommaExpr c | c.getLeftOperand() = e)
3737
or
3838
exists(CommaExpr c | c.getRightOperand() = e and c instanceof ExprInVoidContext)
39+
or
40+
exists(ForStmt for | for.getUpdate() = e)
3941
) and
4042
not e.getActualType() instanceof VoidType
4143
}

0 commit comments

Comments
 (0)