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) {
89
89
)
90
90
}
91
91
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
+
92
103
/** Holds if there is a level step from `nodeFrom` to `nodeTo`, which may depend on the call graph. */
93
104
pragma [ nomagic]
94
105
predicate levelStepCall ( Node nodeFrom , Node nodeTo ) {
95
106
exists ( DataFlowPublic:: ParameterNode param |
96
107
flowThrough ( param ) and
97
- callStep ( nodeTo .asExpr ( ) , nodeFrom , param )
108
+ callStepNoInitialize ( nodeTo .asExpr ( ) , nodeFrom , param )
98
109
)
99
110
}
100
111
You can’t perform that action at this time.
0 commit comments