Skip to content

Commit 03ae588

Browse files
committed
Ruby: Add missing CFG entry for ForwardParameter
1 parent 3ce4101 commit 03ae588

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

ruby/ql/lib/codeql/ruby/controlflow/internal/ControlFlowGraphImpl.qll

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -608,6 +608,8 @@ module Trees {
608608
}
609609
}
610610

611+
private class ForwardParameterTree extends LeafTree, ForwardParameter { }
612+
611613
private class ForInTree extends LeafTree, ForIn { }
612614

613615
/**

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

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2432,10 +2432,28 @@ cfg.rb:
24322432
# 196| forward_param
24332433
#-----| -> exit cfg.rb (normal)
24342434

2435+
# 196| exit forward_param
2436+
2437+
# 196| exit forward_param (normal)
2438+
#-----| -> exit forward_param
2439+
24352440
# 196| a
24362441
#-----| -> b
24372442

24382443
# 196| b
2444+
#-----| -> ...
2445+
2446+
# 196| ...
2447+
#-----| -> self
2448+
2449+
# 197| call to bar
2450+
#-----| -> exit forward_param (normal)
2451+
2452+
# 197| self
2453+
#-----| -> b
2454+
2455+
# 197| b
2456+
#-----| -> call to bar
24392457

24402458
desugar.rb:
24412459
# 1| enter m1

0 commit comments

Comments
 (0)