File tree Expand file tree Collapse file tree 3 files changed +7
-7
lines changed
lib/codeql/ruby/ast/internal Expand file tree Collapse file tree 3 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -406,7 +406,11 @@ import Cached
406
406
407
407
/** Holds if this scope inherits `name` from an outer scope `outer`. */
408
408
private predicate inherits ( Scope:: Range scope , string name , Scope:: Range outer ) {
409
- ( scope instanceof Ruby:: Block or scope instanceof Ruby:: DoBlock ) and
409
+ (
410
+ scope instanceof Ruby:: Block or
411
+ scope instanceof Ruby:: DoBlock or
412
+ scope instanceof Ruby:: Lambda
413
+ ) and
410
414
not scopeDefinesParameterVariable ( scope , name , _) and
411
415
(
412
416
outer = scope .getOuterScope ( ) and
Original file line number Diff line number Diff line change @@ -714,8 +714,7 @@ calls/calls.rb:
714
714
# 351| getAnOperand/getRightOperand: [Lambda] -> { ... }
715
715
# 351| getParameter: [SimpleParameter] x
716
716
# 351| getDefiningAccess: [LocalVariableAccess] x
717
- # 351| getStmt: [MethodCall] call to y
718
- # 351| getReceiver: [SelfVariableAccess] self
717
+ # 351| getStmt: [LocalVariableAccess] y
719
718
# 352| getStmt: [AssignExpr] ... = ...
720
719
# 352| getAnOperand/getLeftOperand: [LocalVariableAccess] f
721
720
# 352| getAnOperand/getRightOperand: [Lambda] -> { ... }
@@ -737,8 +736,7 @@ calls/calls.rb:
737
736
# 354| getParameter: [SimpleParameter] x
738
737
# 354| getDefiningAccess: [LocalVariableAccess] x
739
738
# 355| getStmt: [LocalVariableAccess] x
740
- # 356| getStmt: [MethodCall] call to y
741
- # 356| getReceiver: [SelfVariableAccess] self
739
+ # 356| getStmt: [LocalVariableAccess] y
742
740
# 357| getStmt: [MethodCall] call to unknown_call
743
741
# 357| getReceiver: [SelfVariableAccess] self
744
742
control/cases.rb:
Original file line number Diff line number Diff line change @@ -369,10 +369,8 @@ callsWithReceiver
369
369
| calls.rb:345:1:345:15 | call to foo | calls.rb:345:1:345:15 | self |
370
370
| calls.rb:346:1:346:10 | call to foo | calls.rb:346:1:346:10 | self |
371
371
| calls.rb:347:1:347:7 | call to foo | calls.rb:347:1:347:7 | self |
372
- | calls.rb:351:14:351:14 | call to y | calls.rb:351:14:351:14 | self |
373
372
| calls.rb:352:13:352:17 | call to foo | calls.rb:352:13:352:17 | self |
374
373
| calls.rb:353:13:353:24 | call to unknown_call | calls.rb:353:13:353:24 | self |
375
- | calls.rb:356:3:356:3 | call to y | calls.rb:356:3:356:3 | self |
376
374
| calls.rb:357:3:357:14 | call to unknown_call | calls.rb:357:3:357:14 | self |
377
375
callsWithBlock
378
376
| calls.rb:17:1:17:17 | call to foo | calls.rb:17:5:17:17 | { ... } |
You can’t perform that action at this time.
0 commit comments