Merge branch 'main' into post-release-prep/codeql-cli-2.10.0

This commit is contained in:
Asger F
2022-06-27 20:37:25 +02:00
committed by GitHub
331 changed files with 13701 additions and 4340 deletions

View File

@@ -20,13 +20,21 @@ predicate setterFor(Method m, Field f) {
predicate shadows(LocalVariableDecl d, Class c, Field f, Callable method) {
d.getCallable() = method and
method.getDeclaringType() = c and
c.getAField() = f and
f.getName() = d.getName() and
f.getType() = d.getType() and
not d.getCallable().isStatic() and
f = getField(c, d.getName(), d.getType()) and
not method.isStatic() and
not f.isStatic()
}
/**
* Gets the field with the given name and type from the given class, if any.
*/
pragma[nomagic]
private Field getField(Class c, string name, Type t) {
result.getDeclaringType() = c and
result.getName() = name and
result.getType() = t
}
predicate thisAccess(LocalVariableDecl d, Field f) {
shadows(d, _, f, _) and
exists(VarAccess va | va.getVariable().(Field).getSourceDeclaration() = f |