File tree Expand file tree Collapse file tree 3 files changed +9
-11
lines changed
lib/codeql/ruby/controlflow/internal
test/library-tests/controlflow/graph Expand file tree Collapse file tree 3 files changed +9
-11
lines changed Original file line number Diff line number Diff line change @@ -90,9 +90,7 @@ private predicate mayRaise(Call c) { c = getARescuableBodyChild() }
90
90
91
91
/** A completion of a statement or an expression. */
92
92
abstract class Completion extends TCompletion {
93
- private predicate isValidForSpecific ( AstNode n ) {
94
- exists ( AstNode other | n = other .getDesugared ( ) and this .isValidForSpecific ( other ) )
95
- or
93
+ private predicate isValidForSpecific0 ( AstNode n ) {
96
94
this = n .( NonReturningCall ) .getACompletion ( )
97
95
or
98
96
completionIsValidForStmt ( n , this )
@@ -110,12 +108,19 @@ abstract class Completion extends TCompletion {
110
108
or
111
109
n = any ( RescueModifierExpr parent ) .getBody ( ) and
112
110
this = [ TSimpleCompletion ( ) .( TCompletion ) , TRaiseCompletion ( ) ]
111
+ }
112
+
113
+ private predicate isValidForSpecific ( AstNode n ) {
114
+ this .isValidForSpecific0 ( n )
115
+ or
116
+ exists ( AstNode other | n = other .getDesugared ( ) and this .isValidForSpecific ( other ) )
113
117
or
114
118
mayRaise ( n ) and
115
119
(
116
120
this = TRaiseCompletion ( )
117
121
or
118
- this = TSimpleCompletion ( ) and not n instanceof NonReturningCall
122
+ not any ( Completion c ) .isValidForSpecific0 ( n ) and
123
+ this = TSimpleCompletion ( )
119
124
)
120
125
}
121
126
Original file line number Diff line number Diff line change @@ -6953,11 +6953,6 @@ raise.rb:
6953
6953
#-----| true -> [true] ... || ...
6954
6954
#-----| false -> b2
6955
6955
6956
- # 174| ... || ...
6957
- #-----| true -> 1
6958
- #-----| false -> 2
6959
- #-----| raise -> ExceptionA
6960
-
6961
6956
# 174| [false] ... || ...
6962
6957
#-----| false -> 2
6963
6958
#-----| raise -> ExceptionA
@@ -6971,7 +6966,6 @@ raise.rb:
6971
6966
6972
6967
# 174| ... == ...
6973
6968
#-----| false -> [false] ... || ...
6974
- #-----| -> ... || ...
6975
6969
#-----| true -> [true] ... || ...
6976
6970
#-----| raise -> ExceptionA
6977
6971
Original file line number Diff line number Diff line change @@ -367,7 +367,6 @@ positionalArguments
367
367
| raise.rb:160:5:162:7 | call to bar | raise.rb:160:9:162:7 | -> { ... } |
368
368
| raise.rb:161:7:161:14 | call to raise | raise.rb:161:13:161:14 | "" |
369
369
| raise.rb:168:5:168:12 | call to raise | raise.rb:168:11:168:12 | "" |
370
- | raise.rb:174:8:174:23 | ... \|\| ... | raise.rb:174:14:174:23 | ... == ... |
371
370
| raise.rb:174:8:174:23 | [false] ... \|\| ... | raise.rb:174:14:174:23 | ... == ... |
372
371
| raise.rb:174:8:174:23 | [true] ... \|\| ... | raise.rb:174:14:174:23 | ... == ... |
373
372
| raise.rb:174:14:174:23 | ... == ... | raise.rb:174:20:174:23 | true |
You can’t perform that action at this time.
0 commit comments