Skip to content

Commit b2be1c3

Browse files
aibaarshvitved
andauthored
Update ql/src/codeql_ruby/ApiGraphs.qll
Co-authored-by: Tom Hvitved <hvitved@github.com>
1 parent f18e503 commit b2be1c3

1 file changed

Lines changed: 10 additions & 9 deletions

File tree

ql/src/codeql_ruby/ApiGraphs.qll

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -316,21 +316,22 @@ module API {
316316
)
317317
or
318318
// Calling a method on a node that is a use of `base`
319-
exists(MethodCall call, DataFlow::Node node |
319+
exists(ExprNodes::MethodCallCfgNode call, DataFlow::Node node, string name |
320320
pred.flowsTo(node) and
321-
node.asExpr().getExpr() = call.getReceiver() and
322-
lbl = Label::return(call.getMethodName()) and
323-
call.getMethodName() != "new" and
324-
ref.asExpr().getExpr() = call
321+
node.asExpr() = call.getReceiver() and
322+
name = call.getExpr().getMethodName() and
323+
lbl = Label::return(name) and
324+
name != "new" and
325+
ref.asExpr() = call
325326
)
326327
or
327328
// Calling the `new` method on a node that is a use of `base`, which creates a new instance
328-
exists(MethodCall call, DataFlow::Node node |
329+
exists(ExprNodes::MethodCallCfgNode call, DataFlow::Node node |
329330
pred.flowsTo(node) and
330-
node.asExpr().getExpr() = call.getReceiver() and
331+
node.asExpr() = call.getReceiver() and
331332
lbl = Label::instance() and
332-
call.getMethodName() = "new" and
333-
ref.asExpr().getExpr() = call
333+
call.getExpr().getMethodName() = "new" and
334+
ref.asExpr() = call
334335
)
335336
)
336337
}

0 commit comments

Comments
 (0)