Skip to content

Commit 76cab23

Browse files
committed
Ruby: reuse argumentPositionMatch
1 parent 8704cce commit 76cab23

File tree

1 file changed

+3
-16
lines changed

1 file changed

+3
-16
lines changed

ruby/ql/lib/codeql/ruby/typetracking/TypeTrackerSpecific.qll

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -256,22 +256,9 @@ bindingset[call, component]
256256
private DataFlowPublic::Node evaluateSummaryComponentLocal(
257257
DataFlowPublic::CallNode call, SummaryComponent component
258258
) {
259-
exists(DataFlowDispatch::ParameterPosition pos | component = SummaryComponent::argument(pos) |
260-
exists(int i |
261-
pos.isPositional(i) and
262-
result = call.getPositionalArgument(i)
263-
)
264-
or
265-
exists(string name |
266-
pos.isKeyword(name) and
267-
result = call.getKeywordArgument(name)
268-
)
269-
or
270-
pos.isBlock() and
271-
result = call.getBlock()
272-
or
273-
pos.isSelf() and
274-
result = call.getReceiver()
259+
exists(DataFlowDispatch::ParameterPosition pos |
260+
component = SummaryComponent::argument(pos) and
261+
argumentPositionMatch(call.asExpr(), result, pos)
275262
)
276263
or
277264
component = SummaryComponent::return() and

0 commit comments

Comments
 (0)