Add ExprAggregate as a negative edge in getConjunctionParentRec

This commit is contained in:
Tony Torralba
2023-01-11 09:41:16 +01:00
parent ae8c75ac97
commit ecf568629b
3 changed files with 6 additions and 1 deletions

View File

@@ -28,6 +28,7 @@ module ConjunctionParent<checkAstNodeSig/1 checkAstNode> {
not result instanceof Implication and
not result instanceof Negation and
not result instanceof Predicate and
not result instanceof ExprAggregate and
not result instanceof FullAggregate and
not result instanceof Forex and
not result instanceof Forall

View File

@@ -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 |
| 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 |

View File

@@ -6,6 +6,8 @@ predicate yetAnotherPredicate(int i, int y) { none() }
predicate dbTypePredicate(@location l) { none() }
string predicateWithResult(int i) { none() }
class SmallInt extends int {
SmallInt() { this = [0 .. 10] }
}
@@ -23,6 +25,8 @@ predicate test() {
or
exists(int i | aPredicate(i) and exists(int i2 | i = i2)) // GOOD
or
exists(int i | count(predicateWithResult(i)) = 0) // GOOD
or
exists(int i | count(int y | yetAnotherPredicate(i, y)) > 0) // GOOD
or
exists(int i | forex(int y | yetAnotherPredicate(i, y))) // GOOD