Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit da41cbc

Browse files
committed
C#: Add similar fix to translation of switch statements in C#
1 parent 780010d commit da41cbc

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

csharp/ql/src/semmle/code/csharp/ir/implementation/raw/internal/TranslatedStmt.qll

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -834,6 +834,10 @@ class TranslatedSwitchStmt extends TranslatedStmt {
834834
kind = this.getCaseEdge(caseStmt) and
835835
result = getTranslatedStmt(caseStmt).getFirstInstruction()
836836
)
837+
or
838+
not exists(stmt.getDefaultCase()) and
839+
kind instanceof DefaultEdge and
840+
result = getParent().getChildSuccessor(this)
837841
}
838842

839843
private EdgeKind getCaseEdge(CaseStmt caseStmt) {

0 commit comments

Comments
 (0)