Skip to content

Commit 3ce4101

Browse files
committed
Ruby: Add CFG test for forward parameters
1 parent 4bbfa51 commit 3ce4101

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

ruby/ql/test/library-tests/controlflow/graph/Cfg.expected

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2398,7 +2398,7 @@ cfg.rb:
23982398
#-----| -> yield ...
23992399

24002400
# 194| call to run_block
2401-
#-----| -> exit cfg.rb (normal)
2401+
#-----| -> forward_param
24022402

24032403
# 194| self
24042404
#-----| -> { ... }
@@ -2426,6 +2426,17 @@ cfg.rb:
24262426
# 194| x
24272427
#-----| -> call to puts
24282428

2429+
# 196| enter forward_param
2430+
#-----| -> a
2431+
2432+
# 196| forward_param
2433+
#-----| -> exit cfg.rb (normal)
2434+
2435+
# 196| a
2436+
#-----| -> b
2437+
2438+
# 196| b
2439+
24292440
desugar.rb:
24302441
# 1| enter m1
24312442
#-----| -> x

ruby/ql/test/library-tests/controlflow/graph/cfg.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,10 @@ def run_block
193193

194194
run_block { |x|puts x }
195195

196+
def forward_param(a, b, ...)
197+
bar(b, ...)
198+
end
199+
196200
__END__
197201

198202
Some ignored nonsense

0 commit comments

Comments
 (0)