File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
ruby/ql/lib/codeql/ruby/typetracking Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -89,12 +89,23 @@ private predicate flowThrough(DataFlowPublic::ParameterNode param) {
8989 )
9090}
9191
92+ /** Holds if there is flow from `arg` to `p` via the call `call`, not counting `new -> initialize` call steps. */
93+ pragma [ nomagic]
94+ predicate callStepNoInitialize (
95+ ExprNodes:: CallCfgNode call , Node arg , DataFlowPrivate:: ParameterNodeImpl p
96+ ) {
97+ exists ( DataFlowDispatch:: ParameterPosition pos |
98+ argumentPositionMatch ( call , arg , pos ) and
99+ p .isSourceParameterOf ( DataFlowDispatch:: getTarget ( call ) , pos )
100+ )
101+ }
102+
92103/** Holds if there is a level step from `nodeFrom` to `nodeTo`, which may depend on the call graph. */
93104pragma [ nomagic]
94105predicate levelStepCall ( Node nodeFrom , Node nodeTo ) {
95106 exists ( DataFlowPublic:: ParameterNode param |
96107 flowThrough ( param ) and
97- callStep ( nodeTo .asExpr ( ) , nodeFrom , param )
108+ callStepNoInitialize ( nodeTo .asExpr ( ) , nodeFrom , param )
98109 )
99110}
100111
You can’t perform that action at this time.
0 commit comments