Skip to content

Commit 5d9c64b

Browse files
committed
Ruby: Model flow through initialize constructors
1 parent 9a7628c commit 5d9c64b

File tree

8 files changed

+393
-156
lines changed

8 files changed

+393
-156
lines changed

ruby/ql/lib/codeql/ruby/ast/Call.qll

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,12 @@ class Call extends Expr instanceof CallImpl {
5353

5454
/** Gets a potential target of this call, if any. */
5555
final Callable getATarget() {
56-
exists(DataFlowCall c | this = c.asCall().getExpr() |
57-
TCfgScope(result) = [viableCallable(c), viableCallableLambda(c, _)]
56+
exists(DataFlowCall c |
57+
this = c.asCall().getExpr() and
58+
TCfgScope(result) = viableCallableLambda(c, _)
5859
)
60+
or
61+
result = getTarget(this.getAControlFlowNode())
5962
}
6063

6164
override AstNode getAChild(string pred) {

0 commit comments

Comments
 (0)