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() }
9090
9191/** A completion of a statement or an expression. */
9292abstract 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 ) {
9694 this = n .( NonReturningCall ) .getACompletion ( )
9795 or
9896 completionIsValidForStmt ( n , this )
@@ -110,12 +108,19 @@ abstract class Completion extends TCompletion {
110108 or
111109 n = any ( RescueModifierExpr parent ) .getBody ( ) and
112110 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 ) )
113117 or
114118 mayRaise ( n ) and
115119 (
116120 this = TRaiseCompletion ( )
117121 or
118- this = TSimpleCompletion ( ) and not n instanceof NonReturningCall
122+ not any ( Completion c ) .isValidForSpecific0 ( n ) and
123+ this = TSimpleCompletion ( )
119124 )
120125 }
121126
Original file line number Diff line number Diff line change @@ -6953,11 +6953,6 @@ raise.rb:
69536953#-----| true -> [true] ... || ...
69546954#-----| false -> b2
69556955
6956- # 174| ... || ...
6957- #-----| true -> 1
6958- #-----| false -> 2
6959- #-----| raise -> ExceptionA
6960-
69616956# 174| [false] ... || ...
69626957#-----| false -> 2
69636958#-----| raise -> ExceptionA
@@ -6971,7 +6966,6 @@ raise.rb:
69716966
69726967# 174| ... == ...
69736968#-----| false -> [false] ... || ...
6974- #-----| -> ... || ...
69756969#-----| true -> [true] ... || ...
69766970#-----| raise -> ExceptionA
69776971
Original file line number Diff line number Diff line change @@ -367,7 +367,6 @@ positionalArguments
367367| raise.rb:160:5:162:7 | call to bar | raise.rb:160:9:162:7 | -> { ... } |
368368| raise.rb:161:7:161:14 | call to raise | raise.rb:161:13:161:14 | "" |
369369| 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 | ... == ... |
371370| raise.rb:174:8:174:23 | [false] ... \|\| ... | raise.rb:174:14:174:23 | ... == ... |
372371| raise.rb:174:8:174:23 | [true] ... \|\| ... | raise.rb:174:14:174:23 | ... == ... |
373372| 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