File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed
python/ql/lib/semmle/python/dataflow/new/internal Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -460,15 +460,21 @@ module VariableCapture {
460
460
}
461
461
462
462
class ClosureExpr extends Expr {
463
- ClosureExpr ( ) { this .getNode ( ) instanceof CallableExpr }
463
+ ClosureExpr ( ) {
464
+ this .getNode ( ) instanceof CallableExpr
465
+ or
466
+ this .getNode ( ) instanceof Comp
467
+ }
464
468
465
- predicate hasBody ( Callable body ) { body = this .getNode ( ) .( CallableExpr ) .getInnerScope ( ) }
469
+ predicate hasBody ( Callable body ) {
470
+ body = this .getNode ( ) .( CallableExpr ) .getInnerScope ( )
471
+ or
472
+ body = this .getNode ( ) .( Comp ) .getFunction ( )
473
+ }
466
474
467
475
predicate hasAliasedAccess ( Expr f ) { closureFlowStep + ( this , f ) and not closureFlowStep ( f , _) }
468
476
}
469
477
470
- // TODO: Some basic blocks will not have an enclosing callable
471
- // as their scope are not `Function`s. This leads to inconsistency failures.
472
478
class Callable extends Scope {
473
479
predicate isConstructor ( ) { none ( ) }
474
480
}
You can’t perform that action at this time.
0 commit comments