File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed
lib/codeql/ruby/dataflow/internal
test/library-tests/modules Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -413,10 +413,10 @@ private module Cached {
413
413
// end
414
414
// end
415
415
// ```
416
- exists ( Module target |
416
+ exists ( Module target , MethodBase caller |
417
417
target = m .getSuperClass * ( ) and
418
- selfInMethod ( sourceNode .( SsaSelfDefinitionNode ) .getVariable ( ) , any ( SingletonMethod sm ) ,
419
- target ) and
418
+ selfInMethod ( sourceNode .( SsaSelfDefinitionNode ) .getVariable ( ) , caller , target ) and
419
+ singletonMethod ( caller , _ , _ ) and
420
420
// Singleton methods declared in a block in the top-level may spuriously end up being seen as singleton
421
421
// methods on Object, if the block is actually evaluated in the context of another class.
422
422
// The 'self' inside such a singleton method could then be any class, leading to self-calls
Original file line number Diff line number Diff line change @@ -265,6 +265,8 @@ getTarget
265
265
| private.rb:104:1:104:20 | call to new | calls.rb:117:5:117:16 | new |
266
266
| private.rb:104:1:104:28 | call to call_m1 | private.rb:91:3:93:5 | call_m1 |
267
267
| private.rb:105:1:105:20 | call to new | calls.rb:117:5:117:16 | new |
268
+ | toplevel_self_singleton.rb:29:13:29:19 | call to call_me | toplevel_self_singleton.rb:25:9:26:11 | call_me |
269
+ | toplevel_self_singleton.rb:30:13:30:20 | call to call_you | toplevel_self_singleton.rb:28:9:31:11 | call_you |
268
270
unresolvedCall
269
271
| calls.rb:23:9:23:19 | call to singleton_m |
270
272
| calls.rb:26:9:26:18 | call to instance_m |
@@ -356,8 +358,6 @@ unresolvedCall
356
358
| toplevel_self_singleton.rb:13:9:13:27 | call to ab_singleton_method |
357
359
| toplevel_self_singleton.rb:17:12:21:1 | call to new |
358
360
| toplevel_self_singleton.rb:19:9:19:27 | call to ab_singleton_method |
359
- | toplevel_self_singleton.rb:29:13:29:19 | call to call_me |
360
- | toplevel_self_singleton.rb:30:13:30:20 | call to call_you |
361
361
privateMethod
362
362
| calls.rb:1:1:3:3 | foo |
363
363
| calls.rb:39:1:41:3 | call_instance_m |
You can’t perform that action at this time.
0 commit comments