File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed
python/ql/lib/semmle/python/dataflow/new/internal
ruby/ql/lib/codeql/ruby/dataflow/internal Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ import Attributes
9
9
import LocalSources
10
10
private import semmle.python.essa.SsaCompute
11
11
private import semmle.python.dataflow.new.internal.ImportStar
12
+ private import semmle.python.frameworks.data.ModelsAsData
12
13
private import FlowSummaryImpl as FlowSummaryImpl
13
14
private import semmle.python.frameworks.data.ModelsAsData
14
15
@@ -125,6 +126,12 @@ newtype TNode =
125
126
f = any ( VariableCapture:: CapturedVariable v ) .getACapturingScope ( ) and
126
127
// TODO: Remove this restriction when adding proper support for captured variables in the body of the function we generate for comprehensions
127
128
exists ( TFunction ( f ) )
129
+ } or
130
+ TForbiddenRecursionGuard ( ) {
131
+ none ( ) and
132
+ // We want to prune irrelevant models before materialising data flow nodes, so types contributed
133
+ // directly from CodeQL must expose their pruning info without depending on data flow nodes.
134
+ ( any ( ModelInput:: TypeModel tm ) .isTypeUsed ( "" ) implies any ( ) )
128
135
}
129
136
130
137
private import semmle.python.internal.CachedStages
Original file line number Diff line number Diff line change @@ -588,7 +588,13 @@ private module Cached {
588
588
n in [ - 1 .. 10 ] and
589
589
splatPos = unique( int i | splatArgumentAt ( c , i ) and i > 0 )
590
590
} or
591
- TCaptureNode ( VariableCapture:: Flow:: SynthesizedCaptureNode cn )
591
+ TCaptureNode ( VariableCapture:: Flow:: SynthesizedCaptureNode cn ) or
592
+ TForbiddenRecursionGuard ( ) {
593
+ none ( ) and
594
+ // We want to prune irrelevant models before materialising data flow nodes, so types contributed
595
+ // directly from CodeQL must expose their pruning info without depending on data flow nodes.
596
+ ( any ( ModelInput:: TypeModel tm ) .isTypeUsed ( "" ) implies any ( ) )
597
+ }
592
598
593
599
class TSelfParameterNode = TSelfMethodParameterNode or TSelfToplevelParameterNode ;
594
600
You can’t perform that action at this time.
0 commit comments