File tree Expand file tree Collapse file tree
ruby/ql/lib/codeql/ruby/dataflow/internal Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -298,18 +298,28 @@ private module Cached {
298298 )
299299 }
300300
301+ pragma [ nomagic]
302+ private predicate reachedFromExprOrEntrySsaDef ( Node n ) {
303+ localFlowStepTypeTracker ( any ( Node n0 |
304+ n0 instanceof ExprNode
305+ or
306+ entrySsaDefinition ( n0 )
307+ ) , n )
308+ or
309+ exists ( Node mid |
310+ reachedFromExprOrEntrySsaDef ( mid ) and
311+ localFlowStepTypeTracker ( mid , n )
312+ )
313+ }
314+
301315 cached
302316 predicate isLocalSourceNode ( Node n ) {
303317 n instanceof ParameterNode
304318 or
305319 n instanceof PostUpdateNodes:: ExprPostUpdateNode
306320 or
307321 // Nodes that can't be reached from another entry definition or expression.
308- not localFlowStepTypeTracker + ( any ( Node n0 |
309- n0 instanceof ExprNode
310- or
311- entrySsaDefinition ( n0 )
312- ) , n )
322+ not reachedFromExprOrEntrySsaDef ( n )
313323 or
314324 // Ensure all entry SSA definitions are local sources -- for parameters, this
315325 // is needed by type tracking. Note that when the parameter has a default value,
You can’t perform that action at this time.
0 commit comments