Skip to content

Commit 33be52f

Browse files
committed
Ruby: Allow for flow out of callbacks passed to summarized methods in type tracking
1 parent 224a2c3 commit 33be52f

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -611,8 +611,13 @@ private DataFlow::Node evaluateSummaryComponentStackLocal(
611611
[p.(DataFlow::Node), DataFlowPrivate::LocalFlow::getParameterDefNode(p.getParameter())]
612612
)
613613
or
614-
head = SummaryComponent::return() and
615-
result.(DataFlowPrivate::SynthReturnNode).getCfgScope() = prev.asExpr().getExpr()
614+
exists(DataFlowPrivate::SynthReturnNode ret |
615+
head = SummaryComponent::return() and
616+
ret.getCfgScope() = prev.asExpr().getExpr() and
617+
// We need to include both `ret` and `ret.getAnInput()`, since in type-tracking
618+
// the step from `ret.getAnInput()` to `ret` is considered a call step.
619+
result = [ret.(DataFlow::Node), ret.getAnInput()]
620+
)
616621
or
617622
exists(DataFlow::ContentSet content |
618623
head = SummaryComponent::withoutContent(content) and

0 commit comments

Comments
 (0)