mirror of
https://github.com/github/codeql.git
synced 2026-04-30 19:26:02 +02:00
Merge pull request #2401 from tausbn/python-fix-non-iterable-class-confusion-fp
Python: Fix false positive in `py/non-iterator-in-for-loop`
This commit is contained in:
@@ -367,9 +367,10 @@ predicate receiver(AttrNode instantiation, PointsToContext context, ObjectIntern
|
||||
pragma [noinline]
|
||||
private predicate self_parameter(ParameterDefinition def, PointsToContext context, PythonClassObjectInternal cls) {
|
||||
def.isSelf() and
|
||||
/* Exclude the special parameter name `.0` which is used for unfolded comprehensions. */
|
||||
def.getName() != ".0" and
|
||||
exists(Function scope |
|
||||
def.getScope() = scope and
|
||||
def.isSelf() and
|
||||
context.isRuntime() and context.appliesToScope(scope) and
|
||||
scope.getScope() = cls.getScope() and
|
||||
concrete_class(cls) and
|
||||
|
||||
Reference in New Issue
Block a user