mirror of
https://github.com/github/codeql.git
synced 2026-02-11 04:31:05 +01:00
fix the arity of predicate aliases
This commit is contained in:
committed by
GitHub
parent
8dc3948221
commit
bd86ffb35b
@@ -154,7 +154,14 @@ class Predicate extends TPredicate, AstNode {
|
||||
/**
|
||||
* Gets the number of parameters.
|
||||
*/
|
||||
int getArity() { result = count(getParameter(_)) }
|
||||
int getArity() {
|
||||
not this.(ClasslessPredicate).getAlias() instanceof PredicateExpr and
|
||||
result = count(getParameter(_))
|
||||
or
|
||||
exists(PredicateExpr alias | alias = this.(ClasslessPredicate).getAlias() |
|
||||
result = alias.getArity()
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the return type (if any) of the predicate.
|
||||
|
||||
@@ -240,6 +240,7 @@ module PredConsistency {
|
||||
query predicate noResolveCall(Call c) {
|
||||
not resolveCall(c, _) and
|
||||
not c instanceof NoneCall and
|
||||
not c instanceof AnyCall and
|
||||
not c.getLocation().getFile().getAbsolutePath().regexpMatch(".*/(test|examples)/.*")
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user