C#: Address review comments.

This commit is contained in:
Calum Grant
2019-10-02 10:42:06 +01:00
parent 8408e90b5f
commit 28c34ad41e
2 changed files with 3 additions and 6 deletions

View File

@@ -225,7 +225,9 @@ private module SwithStmtInternal {
/** Implicitly reorder case statements to put the default case last if needed. */
private predicate caseIndex(SwitchStmt ss, CaseStmt case, int index) {
exists(int i | case = ss.getChildStmt(i) |
if case instanceof DefaultCase then index = 1000000 else index = i
if case instanceof DefaultCase
then index = max(int j | exists(ss.getChildStmt(j))) + 1
else index = i
)
}

View File

@@ -741,7 +741,6 @@ module ControlFlow {
TLastRecBooleanNegationCompletion() or
TLastRecNonBooleanCompletion() or
TLastRecBreakCompletion() or
TLastRecNonBreakCompletion() or
TLastRecSwitchAbnormalCompletion() or
TLastRecInvalidOperationException() or
TLastRecNonContinueCompletion() or
@@ -1150,10 +1149,6 @@ module ControlFlow {
c0 instanceof BreakCompletion and
c instanceof BreakNormalCompletion
or
rec = TLastRecNonBreakCompletion() and
not c0 instanceof BreakCompletion and
c = c0
or
rec = TLastRecSwitchAbnormalCompletion() and
not c instanceof BreakCompletion and
not c instanceof NormalCompletion and