Skip to content

Commit 1e973f3

Browse files
authored
Fix getType for aggregates
We were only including the `strict` variant of `count` and not any of the other ones (spot the mistake!). Also, `unique` was added as a recognised aggregate name.
1 parent 0ff0aec commit 1e973f3

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

ql/src/codeql_ql/ast/Ast.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1506,14 +1506,14 @@ class Aggregate extends TAggregate, Expr {
15061506

15071507
override Type getType() {
15081508
exists(PrimitiveType prim | prim = result |
1509-
kind.regexpMatch("(strict)?count|sum|min|max|rank") and
1509+
kind.regexpMatch("(strict)?(count|sum|min|max|rank)") and
15101510
result.getName() = "int"
15111511
or
15121512
kind.regexpMatch("(strict)?concat") and
15131513
result.getName() = "string"
15141514
)
15151515
or
1516-
kind = ["any", "min", "max"] and
1516+
kind = ["any", "min", "max", "unique"] and
15171517
not exists(getExpr(_)) and
15181518
result = getArgument(0).getTypeExpr().getResolvedType()
15191519
or

0 commit comments

Comments
 (0)