File tree Expand file tree Collapse file tree 2 files changed +3
-6
lines changed
csharp/ql/src/semmle/code/csharp Expand file tree Collapse file tree 2 files changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -225,7 +225,9 @@ private module SwithStmtInternal {
225
225
/** Implicitly reorder case statements to put the default case last if needed. */
226
226
private predicate caseIndex ( SwitchStmt ss , CaseStmt case , int index ) {
227
227
exists ( int i | case = ss .getChildStmt ( i ) |
228
- if case instanceof DefaultCase then index = 1000000 else index = i
228
+ if case instanceof DefaultCase
229
+ then index = max ( int j | exists ( ss .getChildStmt ( j ) ) ) + 1
230
+ else index = i
229
231
)
230
232
}
231
233
Original file line number Diff line number Diff line change @@ -741,7 +741,6 @@ module ControlFlow {
741
741
TLastRecBooleanNegationCompletion ( ) or
742
742
TLastRecNonBooleanCompletion ( ) or
743
743
TLastRecBreakCompletion ( ) or
744
- TLastRecNonBreakCompletion ( ) or
745
744
TLastRecSwitchAbnormalCompletion ( ) or
746
745
TLastRecInvalidOperationException ( ) or
747
746
TLastRecNonContinueCompletion ( ) or
@@ -1150,10 +1149,6 @@ module ControlFlow {
1150
1149
c0 instanceof BreakCompletion and
1151
1150
c instanceof BreakNormalCompletion
1152
1151
or
1153
- rec = TLastRecNonBreakCompletion ( ) and
1154
- not c0 instanceof BreakCompletion and
1155
- c = c0
1156
- or
1157
1152
rec = TLastRecSwitchAbnormalCompletion ( ) and
1158
1153
not c instanceof BreakCompletion and
1159
1154
not c instanceof NormalCompletion and
You can’t perform that action at this time.
0 commit comments