mirror of
https://github.com/github/codeql.git
synced 2026-04-29 10:45:15 +02:00
QL: Remove omittable exists variables
This commit is contained in:
@@ -30,17 +30,15 @@ private ClassPredicate getUltimateDef(ClassPredicate p) {
|
||||
}
|
||||
|
||||
predicate redundantOverride(ClassPredicate pred, ClassPredicate sup) {
|
||||
exists(MemberCall mc |
|
||||
forwardingOverride(pred, mc, sup) and
|
||||
// overridden to provide more precise QL doc
|
||||
not exists(pred.getQLDoc()) and
|
||||
// overridden to disambiguate
|
||||
not exists(ClassPredicate other |
|
||||
getUltimateDef(sup) != getUltimateDef(other) and
|
||||
pred.getDeclaringType().getASuperType+() = other.getDeclaringType() and
|
||||
not sup.overrides*(other) and
|
||||
other.getName() = pred.getName() and
|
||||
other.getArity() = pred.getArity()
|
||||
)
|
||||
forwardingOverride(pred, _, sup) and
|
||||
// overridden to provide more precise QL doc
|
||||
not exists(pred.getQLDoc()) and
|
||||
// overridden to disambiguate
|
||||
not exists(ClassPredicate other |
|
||||
getUltimateDef(sup) != getUltimateDef(other) and
|
||||
pred.getDeclaringType().getASuperType+() = other.getDeclaringType() and
|
||||
not sup.overrides*(other) and
|
||||
other.getName() = pred.getName() and
|
||||
other.getArity() = pred.getArity()
|
||||
)
|
||||
}
|
||||
|
||||
@@ -202,9 +202,9 @@ module DataFlow {
|
||||
varaccesValue(e2, v, scope)
|
||||
)
|
||||
or
|
||||
exists(VarDecl v, Formula f, Select sel |
|
||||
exists(Formula f, Select sel |
|
||||
getParentFormula*(f) = sel.getWhere() and
|
||||
varaccesValue(e1, v, f) and
|
||||
varaccesValue(e1, _, f) and
|
||||
sel.getExpr(_) = e2
|
||||
)
|
||||
or
|
||||
|
||||
Reference in New Issue
Block a user