File tree Expand file tree Collapse file tree 1 file changed +15
-5
lines changed
ruby/ql/lib/codeql/ruby/dataflow/internal Expand file tree Collapse file tree 1 file changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -298,18 +298,28 @@ private module Cached {
298
298
)
299
299
}
300
300
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
+
301
315
cached
302
316
predicate isLocalSourceNode ( Node n ) {
303
317
n instanceof ParameterNode
304
318
or
305
319
n instanceof PostUpdateNodes:: ExprPostUpdateNode
306
320
or
307
321
// 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 )
313
323
or
314
324
// Ensure all entry SSA definitions are local sources -- for parameters, this
315
325
// 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