Skip to content

Commit d097946

Browse files
committed
C++: No need for this additional case.
1 parent 046d0d4 commit d097946

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

cpp/ql/src/Critical/ScanfChecks.qll

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,9 @@ private import semmle.code.cpp.controlflow.IRGuards
44
private import semmle.code.cpp.ir.ValueNumbering
55

66
private predicate exprInBooleanContext(Expr e) {
7-
exists(IRGuardCondition gc |
8-
exists(Instruction i |
9-
i.getUnconvertedResultExpression() = e and
10-
gc.comparesEq(valueNumber(i).getAUse(), 0, _, _)
11-
)
12-
or
13-
gc.getUnconvertedResultExpression() = e
7+
exists(IRGuardCondition gc, Instruction i |
8+
i.getUnconvertedResultExpression() = e and
9+
gc.comparesEq(valueNumber(i).getAUse(), 0, _, _)
1410
)
1511
}
1612

0 commit comments

Comments
 (0)