Skip to content

Commit f1f7930

Browse files
committed
Make all self nodes LocalSourceNodes
1 parent 94f0f8d commit f1f7930

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

ruby/ql/lib/codeql/ruby/dataflow/internal/DataFlowPrivate.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ private module Cached {
236236
// for `self`. At that point, the `self`s returned by `trackInstance`
237237
// in `DataFlowDispatch.qll` should refer to the post-update node,
238238
// and we can remove this case.
239-
n instanceof SelfArgumentNode
239+
n.asExpr().getExpr() instanceof Self
240240
or
241241
not localFlowStepTypeTracker+(any(Node e |
242242
e instanceof ExprNode

ruby/ql/test/library-tests/modules/callgraph.expected

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ getTarget
22
| calls.rb:2:5:2:14 | call to puts | calls.rb:87:5:87:17 | puts |
33
| calls.rb:5:1:5:3 | call to foo | calls.rb:1:1:3:3 | foo |
44
| calls.rb:5:1:5:3 | call to foo | calls.rb:71:1:75:3 | foo |
5+
| calls.rb:8:5:8:14 | call to puts | calls.rb:87:5:87:17 | puts |
6+
| calls.rb:11:1:11:8 | call to bar | calls.rb:7:1:9:3 | bar |
57
| calls.rb:13:1:13:8 | call to foo | calls.rb:1:1:3:3 | foo |
68
| calls.rb:13:1:13:8 | call to foo | calls.rb:71:1:75:3 | foo |
79
| calls.rb:22:5:22:15 | call to singleton_m | calls.rb:17:5:17:29 | singleton_m |
@@ -84,8 +86,6 @@ getTarget
8486
| private.rb:28:1:28:12 | call to public | private.rb:5:3:6:5 | public |
8587
| private.rb:30:1:30:15 | call to private_on_main | private.rb:21:1:22:3 | private_on_main |
8688
unresolvedCall
87-
| calls.rb:8:5:8:14 | call to puts |
88-
| calls.rb:11:1:11:8 | call to bar |
8989
| calls.rb:19:5:19:14 | call to instance_m |
9090
| calls.rb:20:5:20:19 | call to instance_m |
9191
| calls.rb:26:1:26:12 | call to instance_m |

0 commit comments

Comments
 (0)