@@ -388,23 +388,27 @@ module LocalFlow {
388
388
module VariableCapture {
389
389
private import codeql.dataflow.VariableCapture as Shared
390
390
391
- class ExprCfgNode extends ControlFlowNode {
392
- ExprCfgNode ( ) { isExpressionNode ( this ) }
393
- }
394
-
395
- private predicate closureFlowStep ( ExprCfgNode nodeFrom , ExprCfgNode nodeTo ) {
396
- // TODO: Other languages have an extra case here looking like
397
- // simpleAstFlowStep(nodeFrom, nodeTo)
398
- // we should investigate the potential benefit of adding that.
399
- exists ( SsaVariable def |
400
- def .getAUse ( ) = nodeTo and
401
- def .getAnUltimateDefinition ( ) .getDefinition ( ) .( DefinitionNode ) .getValue ( ) = nodeFrom
402
- )
403
- }
404
-
405
391
private module CaptureInput implements Shared:: InputSig< Location > {
406
392
private import python as PY
407
393
394
+ additional class ExprCfgNode extends ControlFlowNode {
395
+ ExprCfgNode ( ) { isExpressionNode ( this ) }
396
+ }
397
+
398
+ private predicate closureFlowStep ( ExprCfgNode nodeFrom , ExprCfgNode nodeTo ) {
399
+ // TODO: Other languages have an extra case here looking like
400
+ // simpleAstFlowStep(nodeFrom, nodeTo)
401
+ // we should investigate the potential benefit of adding that.
402
+ exists ( SsaVariable def |
403
+ def .getAUse ( ) = nodeTo and
404
+ def .getAnUltimateDefinition ( ) .getDefinition ( ) .( DefinitionNode ) .getValue ( ) = nodeFrom
405
+ )
406
+ }
407
+
408
+ class Callable extends Scope {
409
+ predicate isConstructor ( ) { none ( ) }
410
+ }
411
+
408
412
class BasicBlock extends PY:: BasicBlock {
409
413
Callable getEnclosingCallable ( ) { result = this .getScope ( ) }
410
414
@@ -482,10 +486,6 @@ module VariableCapture {
482
486
483
487
predicate hasAliasedAccess ( Expr f ) { closureFlowStep + ( this , f ) and not closureFlowStep ( f , _) }
484
488
}
485
-
486
- class Callable extends Scope {
487
- predicate isConstructor ( ) { none ( ) }
488
- }
489
489
}
490
490
491
491
class CapturedVariable = CaptureInput:: CapturedVariable ;
0 commit comments