Skip to content

Commit c866f88

Browse files
committed
CFG: Add missing propagatesAbnormal overrides
1 parent 9871698 commit c866f88

2 files changed

Lines changed: 4 additions & 9 deletions

File tree

ql/src/codeql_ruby/controlflow/internal/ControlFlowGraphImpl.qll

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -880,6 +880,8 @@ module Trees {
880880
}
881881

882882
private class LambdaTree extends BodyStmtTree, Lambda {
883+
final override predicate propagatesAbnormal(AstNode child) { none() }
884+
883885
/** Gets the `i`th child in the body of this block. */
884886
final override AstNode getBodyChild(int i, boolean rescuable) {
885887
result = this.getParameter(i) and rescuable = false
@@ -1158,6 +1160,8 @@ module Trees {
11581160
}
11591161

11601162
private class SingletonMethodTree extends BodyStmtTree, SingletonMethod {
1163+
final override predicate propagatesAbnormal(AstNode child) { none() }
1164+
11611165
/** Gets the `i`th child in the body of this block. */
11621166
final override AstNode getBodyChild(int i, boolean rescuable) {
11631167
result = this.getParameter(i) and rescuable = false

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

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3173,9 +3173,6 @@ raise.rb:
31733173

31743174
# 1| exit raise.rb
31753175

3176-
# 1| exit raise.rb (abnormal)
3177-
#-----| -> exit raise.rb
3178-
31793176
# 1| exit raise.rb (normal)
31803177
#-----| -> exit raise.rb
31813178

@@ -4333,9 +4330,6 @@ raise.rb:
43334330

43344331
# 159| exit do ... end
43354332

4336-
# 159| exit do ... end (abnormal)
4337-
#-----| -> exit do ... end
4338-
43394333
# 159| exit do ... end (normal)
43404334
#-----| -> exit do ... end
43414335

@@ -4363,7 +4357,6 @@ raise.rb:
43634357
#-----| -> x
43644358

43654359
# 161| call to raise
4366-
#-----| raise -> exit do ... end (abnormal)
43674360
#-----| raise -> exit -> { ... } (abnormal)
43684361

43694362
# 161| ... unless ...
@@ -4397,9 +4390,7 @@ raise.rb:
43974390
#-----| -> m
43984391

43994392
# 168| call to raise
4400-
#-----| raise -> C
44014393
#-----| raise -> exit m (abnormal)
4402-
#-----| raise -> exit raise.rb (abnormal)
44034394

44044395
# 168| self
44054396
#-----| -> ""

0 commit comments

Comments
 (0)