Skip to content

Commit 28c34ad

Browse files
committed
C#: Address review comments.
1 parent 8408e90 commit 28c34ad

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

csharp/ql/src/semmle/code/csharp/Stmt.qll

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,9 @@ private module SwithStmtInternal {
225225
/** Implicitly reorder case statements to put the default case last if needed. */
226226
private predicate caseIndex(SwitchStmt ss, CaseStmt case, int index) {
227227
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
229231
)
230232
}
231233

csharp/ql/src/semmle/code/csharp/controlflow/ControlFlowGraph.qll

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -741,7 +741,6 @@ module ControlFlow {
741741
TLastRecBooleanNegationCompletion() or
742742
TLastRecNonBooleanCompletion() or
743743
TLastRecBreakCompletion() or
744-
TLastRecNonBreakCompletion() or
745744
TLastRecSwitchAbnormalCompletion() or
746745
TLastRecInvalidOperationException() or
747746
TLastRecNonContinueCompletion() or
@@ -1150,10 +1149,6 @@ module ControlFlow {
11501149
c0 instanceof BreakCompletion and
11511150
c instanceof BreakNormalCompletion
11521151
or
1153-
rec = TLastRecNonBreakCompletion() and
1154-
not c0 instanceof BreakCompletion and
1155-
c = c0
1156-
or
11571152
rec = TLastRecSwitchAbnormalCompletion() and
11581153
not c instanceof BreakCompletion and
11591154
not c instanceof NormalCompletion and

0 commit comments

Comments
 (0)