mirror of
https://github.com/github/codeql.git
synced 2026-05-01 11:45:14 +02:00
Python: Modernise py/loop-variable-capture
This commit is contained in:
@@ -34,7 +34,7 @@ predicate escaping_capturing_looping_construct(CallableExpr capturing, AstNode l
|
||||
and
|
||||
// Escapes if used out side of for loop or is a lambda in a comprehension
|
||||
(
|
||||
exists(Expr e, For forloop | forloop = loop and e.refersTo(_, _, capturing) | not forloop.contains(e))
|
||||
exists(Expr e, For forloop | forloop = loop and e.pointsTo(_, _, capturing) | not forloop.contains(e))
|
||||
or
|
||||
loop.(Comp).getElt() = capturing
|
||||
or
|
||||
|
||||
Reference in New Issue
Block a user