File tree 1 file changed +6
-2
lines changed
python/ql/lib/semmle/python/dataflow/new/internal
1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -118,7 +118,7 @@ newtype TNode =
118
118
} or
119
119
/** A synthetic node representing a captured variable. */
120
120
TCaptureNode ( VariableCapture:: Flow:: SynthesizedCaptureNode cn ) or
121
- /** TODO: extende to also cover lambdas */
121
+ /** A synthetic node representing the heap of a function. Used for variable capture. */
122
122
TLambdaSelfReferenceNode ( Function f ) {
123
123
f = any ( VariableCapture:: CapturedVariable v ) .getACapturingScope ( )
124
124
}
@@ -489,7 +489,11 @@ class CaptureNode extends Node, TCaptureNode {
489
489
490
490
VariableCapture:: Flow:: SynthesizedCaptureNode getSynthesizedCaptureNode ( ) { result = cn }
491
491
492
- override DataFlowCallable getEnclosingCallable ( ) { result = TFunction ( cn .getEnclosingCallable ( ) ) }
492
+ override DataFlowCallable getEnclosingCallable ( ) {
493
+ result = TFunction ( cn .getEnclosingCallable ( ) )
494
+ or
495
+ result = TModule ( cn .getEnclosingCallable ( ) )
496
+ }
493
497
494
498
override Location getLocation ( ) { result = cn .getLocation ( ) }
495
499
You can’t perform that action at this time.
0 commit comments