Skip to content

Commit ecf5686

Browse files
committed
Add ExprAggregate as a negative edge in getConjunctionParentRec
1 parent ae8c75a commit ecf5686

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

ql/ql/src/codeql_ql/style/ConjunctionParent.qll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ module ConjunctionParent<checkAstNodeSig/1 checkAstNode> {
2828
not result instanceof Implication and
2929
not result instanceof Negation and
3030
not result instanceof Predicate and
31+
not result instanceof ExprAggregate and
3132
not result instanceof FullAggregate and
3233
not result instanceof Forex and
3334
not result instanceof Forall
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
| Test.qll:18:10:18:14 | i | This exists variable can be omitted by using a don't-care expression $@. | Test.qll:18:29:18:29 | i | in this argument |
1+
| Test.qll:20:10:20:14 | i | This exists variable can be omitted by using a don't-care expression $@. | Test.qll:20:29:20:29 | i | in this argument |

ql/ql/test/queries/style/OmittableExists/Test.qll

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ predicate yetAnotherPredicate(int i, int y) { none() }
66

77
predicate dbTypePredicate(@location l) { none() }
88

9+
string predicateWithResult(int i) { none() }
10+
911
class SmallInt extends int {
1012
SmallInt() { this = [0 .. 10] }
1113
}
@@ -23,6 +25,8 @@ predicate test() {
2325
or
2426
exists(int i | aPredicate(i) and exists(int i2 | i = i2)) // GOOD
2527
or
28+
exists(int i | count(predicateWithResult(i)) = 0) // GOOD
29+
or
2630
exists(int i | count(int y | yetAnotherPredicate(i, y)) > 0) // GOOD
2731
or
2832
exists(int i | forex(int y | yetAnotherPredicate(i, y))) // GOOD

0 commit comments

Comments
 (0)