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
406406
407407/** Holds if this scope inherits `name` from an outer scope `outer`. */
408408private 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
410414 not scopeDefinesParameterVariable ( scope , name , _) and
411415 (
412416 outer = scope .getOuterScope ( ) and
Original file line number Diff line number Diff line change @@ -714,8 +714,7 @@ calls/calls.rb:
714714# 351| getAnOperand/getRightOperand: [Lambda] -> { ... }
715715# 351| getParameter: [SimpleParameter] x
716716# 351| getDefiningAccess: [LocalVariableAccess] x
717- # 351| getStmt: [MethodCall] call to y
718- # 351| getReceiver: [SelfVariableAccess] self
717+ # 351| getStmt: [LocalVariableAccess] y
719718# 352| getStmt: [AssignExpr] ... = ...
720719# 352| getAnOperand/getLeftOperand: [LocalVariableAccess] f
721720# 352| getAnOperand/getRightOperand: [Lambda] -> { ... }
@@ -737,8 +736,7 @@ calls/calls.rb:
737736# 354| getParameter: [SimpleParameter] x
738737# 354| getDefiningAccess: [LocalVariableAccess] x
739738# 355| getStmt: [LocalVariableAccess] x
740- # 356| getStmt: [MethodCall] call to y
741- # 356| getReceiver: [SelfVariableAccess] self
739+ # 356| getStmt: [LocalVariableAccess] y
742740# 357| getStmt: [MethodCall] call to unknown_call
743741# 357| getReceiver: [SelfVariableAccess] self
744742control/cases.rb:
Original file line number Diff line number Diff line change @@ -369,10 +369,8 @@ callsWithReceiver
369369| calls.rb:345:1:345:15 | call to foo | calls.rb:345:1:345:15 | self |
370370| calls.rb:346:1:346:10 | call to foo | calls.rb:346:1:346:10 | self |
371371| 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 |
373372| calls.rb:352:13:352:17 | call to foo | calls.rb:352:13:352:17 | self |
374373| 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 |
376374| calls.rb:357:3:357:14 | call to unknown_call | calls.rb:357:3:357:14 | self |
377375callsWithBlock
378376| 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