Skip to content

Commit b0ad927

Browse files
committed
C++: Remove useUsePair.
1 parent 40637c1 commit b0ad927

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

cpp/ql/src/Security/CWE/CWE-191/UnsignedDifferenceExpressionComparedZero.ql

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,6 @@ predicate isGuarded(SubExpr sub, Expr left, Expr right) {
3737
predicate exprIsSubLeftOrLess(SubExpr sub, Expr e) {
3838
e = sub.getLeftOperand()
3939
or
40-
exists(Expr other |
41-
// use-use
42-
exprIsSubLeftOrLess(sub, other) and
43-
(
44-
useUsePair(_, other, e) or
45-
useUsePair(_, e, other)
46-
)
47-
)
48-
or
4940
exists(Expr other |
5041
// dataflow
5142
exprIsSubLeftOrLess(sub, other) and

cpp/ql/test/query-tests/Security/CWE/CWE-191/UnsignedDifferenceExpressionComparedZero/UnsignedDifferenceExpressionComparedZero.expected

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
| test.cpp:6:5:6:13 | ... > ... | Unsigned subtraction can never be negative. |
22
| test.cpp:10:8:10:24 | ... > ... | Unsigned subtraction can never be negative. |
3+
| test.cpp:22:12:22:20 | ... > ... | Unsigned subtraction can never be negative. |
4+
| test.cpp:32:12:32:20 | ... > ... | Unsigned subtraction can never be negative. |
35
| test.cpp:62:5:62:13 | ... > ... | Unsigned subtraction can never be negative. |
46
| test.cpp:75:8:75:16 | ... > ... | Unsigned subtraction can never be negative. |
57
| test.cpp:101:6:101:14 | ... > ... | Unsigned subtraction can never be negative. |
@@ -9,6 +11,8 @@
911
| test.cpp:152:7:152:15 | ... > ... | Unsigned subtraction can never be negative. |
1012
| test.cpp:182:6:182:14 | ... > ... | Unsigned subtraction can never be negative. |
1113
| test.cpp:208:6:208:14 | ... > ... | Unsigned subtraction can never be negative. |
14+
| test.cpp:219:7:219:15 | ... > ... | Unsigned subtraction can never be negative. |
15+
| test.cpp:226:8:226:16 | ... > ... | Unsigned subtraction can never be negative. |
1216
| test.cpp:252:10:252:18 | ... > ... | Unsigned subtraction can never be negative. |
1317
| test.cpp:266:10:266:24 | ... > ... | Unsigned subtraction can never be negative. |
1418
| test.cpp:276:11:276:19 | ... > ... | Unsigned subtraction can never be negative. |

0 commit comments

Comments
 (0)