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
99import LocalSources
1010private import semmle.python.essa.SsaCompute
1111private import semmle.python.dataflow.new.internal.ImportStar
12+ private import semmle.python.frameworks.data.ModelsAsData
1213private import FlowSummaryImpl as FlowSummaryImpl
1314private import semmle.python.frameworks.data.ModelsAsData
1415
@@ -125,6 +126,12 @@ newtype TNode =
125126 f = any ( VariableCapture:: CapturedVariable v ) .getACapturingScope ( ) and
126127 // TODO: Remove this restriction when adding proper support for captured variables in the body of the function we generate for comprehensions
127128 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 ( ) )
128135 }
129136
130137private import semmle.python.internal.CachedStages
Original file line number Diff line number Diff line change @@ -588,7 +588,13 @@ private module Cached {
588588 n in [ - 1 .. 10 ] and
589589 splatPos = unique( int i | splatArgumentAt ( c , i ) and i > 0 )
590590 } 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+ }
592598
593599 class TSelfParameterNode = TSelfMethodParameterNode or TSelfToplevelParameterNode ;
594600
You can’t perform that action at this time.
0 commit comments