File tree Expand file tree Collapse file tree 3 files changed +11
-9
lines changed
lib/codeql/ruby/controlflow/internal
test/library-tests/controlflow/graph Expand file tree Collapse file tree 3 files changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -227,6 +227,8 @@ private predicate inMatchingContext(AstNode n) {
227
227
or
228
228
n instanceof CasePattern
229
229
or
230
+ n = any ( VariableReferencePattern p ) .getVariableAccess ( )
231
+ or
230
232
n = any ( CasePattern c ) .getDesugared ( )
231
233
or
232
234
n .( Trees:: DefaultValueParameterTree ) .hasDefaultValue ( )
Original file line number Diff line number Diff line change @@ -722,7 +722,7 @@ module Trees {
722
722
override ControlFlowTree getChildElement ( int i ) { result = this .getPattern ( ) and i = 0 }
723
723
}
724
724
725
- private class VariableReferencePatternTree extends StandardPostOrderTree , VariableReferencePattern {
725
+ private class VariableReferencePatternTree extends StandardPreOrderTree , VariableReferencePattern {
726
726
override ControlFlowTree getChildElement ( int i ) { result = this .getVariableAccess ( ) and i = 0 }
727
727
}
728
728
Original file line number Diff line number Diff line change @@ -1046,14 +1046,14 @@ case.rb:
1046
1046
#-----| match -> exit case_match_various (normal)
1047
1047
1048
1048
# 74| in ... then ...
1049
- #-----| -> foo
1049
+ #-----| -> ^...
1050
1050
1051
1051
# 74| ^...
1052
- #-----| no-match -> in ... then ...
1053
- #-----| match -> exit case_match_various (normal)
1052
+ #-----| -> foo
1054
1053
1055
1054
# 74| foo
1056
- #-----| -> ^...
1055
+ #-----| no-match -> in ... then ...
1056
+ #-----| match -> exit case_match_various (normal)
1057
1057
1058
1058
# 75| in ... then ...
1059
1059
#-----| -> "string"
@@ -1154,15 +1154,15 @@ case.rb:
1154
1154
#-----| -> 5
1155
1155
1156
1156
# 83| 5
1157
- #-----| no-match -> foo
1157
+ #-----| no-match -> ^...
1158
1158
#-----| match -> exit case_match_various (normal)
1159
1159
1160
1160
# 83| ^...
1161
- #-----| no-match -> "string"
1162
- #-----| match -> exit case_match_various (normal)
1161
+ #-----| -> foo
1163
1162
1164
1163
# 83| foo
1165
- #-----| -> ^...
1164
+ #-----| no-match -> "string"
1165
+ #-----| match -> exit case_match_various (normal)
1166
1166
1167
1167
# 83| "string"
1168
1168
#-----| no-match -> in ... then ...
You can’t perform that action at this time.
0 commit comments