File tree Expand file tree Collapse file tree
lib/codeql/ruby/controlflow/internal
test/library-tests/controlflow/graph Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -227,6 +227,8 @@ private predicate inMatchingContext(AstNode n) {
227227 or
228228 n instanceof CasePattern
229229 or
230+ n = any ( VariableReferencePattern p ) .getVariableAccess ( )
231+ or
230232 n = any ( CasePattern c ) .getDesugared ( )
231233 or
232234 n .( Trees:: DefaultValueParameterTree ) .hasDefaultValue ( )
Original file line number Diff line number Diff line change @@ -722,7 +722,7 @@ module Trees {
722722 override ControlFlowTree getChildElement ( int i ) { result = this .getPattern ( ) and i = 0 }
723723 }
724724
725- private class VariableReferencePatternTree extends StandardPostOrderTree , VariableReferencePattern {
725+ private class VariableReferencePatternTree extends StandardPreOrderTree , VariableReferencePattern {
726726 override ControlFlowTree getChildElement ( int i ) { result = this .getVariableAccess ( ) and i = 0 }
727727 }
728728
Original file line number Diff line number Diff line change @@ -1046,14 +1046,14 @@ case.rb:
10461046#-----| match -> exit case_match_various (normal)
10471047
10481048# 74| in ... then ...
1049- #-----| -> foo
1049+ #-----| -> ^...
10501050
10511051# 74| ^...
1052- #-----| no-match -> in ... then ...
1053- #-----| match -> exit case_match_various (normal)
1052+ #-----| -> foo
10541053
10551054# 74| foo
1056- #-----| -> ^...
1055+ #-----| no-match -> in ... then ...
1056+ #-----| match -> exit case_match_various (normal)
10571057
10581058# 75| in ... then ...
10591059#-----| -> "string"
@@ -1154,15 +1154,15 @@ case.rb:
11541154#-----| -> 5
11551155
11561156# 83| 5
1157- #-----| no-match -> foo
1157+ #-----| no-match -> ^...
11581158#-----| match -> exit case_match_various (normal)
11591159
11601160# 83| ^...
1161- #-----| no-match -> "string"
1162- #-----| match -> exit case_match_various (normal)
1161+ #-----| -> foo
11631162
11641163# 83| foo
1165- #-----| -> ^...
1164+ #-----| no-match -> "string"
1165+ #-----| match -> exit case_match_various (normal)
11661166
11671167# 83| "string"
11681168#-----| no-match -> in ... then ...
You can’t perform that action at this time.
0 commit comments