From 36007d78924262dfad4f6f8f1c3437a60379174d Mon Sep 17 00:00:00 2001 From: Tom Hvitved Date: Wed, 18 Nov 2026 11:30:35 +0100 Subject: [PATCH 1/6] CFG: Move `Case` related predicates --- .../codeql/controlflow/ControlFlowGraph.qll | 162 +++++++++--------- 1 file changed, 81 insertions(+), 81 deletions(-) diff --git a/shared/controlflow/codeql/controlflow/ControlFlowGraph.qll b/shared/controlflow/codeql/controlflow/ControlFlowGraph.qll index 78d894c01a36..743dff32132c 100644 --- a/shared/controlflow/codeql/controlflow/ControlFlowGraph.qll +++ b/shared/controlflow/codeql/controlflow/ControlFlowGraph.qll @@ -610,6 +610,87 @@ module Make0 Ast> { shortcircuitValue.(NullnessSuccessor).getValue() = false } + /** + * Gets an integer indicating the control flow order of a case within a + * switch. This is equal to the AST order, except that default cases are + * always last in control flow order, even if some languages allow them + * to appear before other cases in the AST. + */ + private int getCaseControlFlowOrder(Switch s, Case c) { + exists(int pos | s.getCase(pos) = c | + // if a default case is not last in the AST, move it last in the CFG order + if c instanceof DefaultCase and exists(s.getCase(pos + 1)) + then result = strictcount(s.getCase(_)) + else result = pos + ) + } + + private module CaseDenseRankInput implements DenseRankInputSig1 { + class C = Switch; + + class Ranked = Case; + + predicate getRank = getCaseControlFlowOrder/2; + } + + private predicate getRankedCaseCfgOrder = DenseRank1::denseRank/2; + + private int numberOfStmts(Switch s) { result = strictcount(s.getStmt(_)) } + + private predicate caseIndex(Switch s, Case c, int caseIdx, int caseStmtPos) { + c = s.getCase(caseIdx) and + c = s.getStmt(caseStmtPos) + } + + /** + * Gets the body element of `case` at the specified (zero-based) `index`. + * + * This is either unique when the case has a single right-hand side, or it + * is the sequence of statements between this case and the next case. + */ + private AstNode getCaseBodyElement(Case case, int index) { + result = case.getBody() and index = 0 + or + not exists(case.getBody()) and + exists(Switch s, int caseIdx, int caseStmtPos, int nextCaseStmtPos | + caseIndex(pragma[only_bind_into](s), case, caseIdx, caseStmtPos) and + ( + caseIndex(pragma[only_bind_into](s), _, caseIdx + 1, nextCaseStmtPos) + or + not exists(s.getCase(caseIdx + 1)) and + nextCaseStmtPos = numberOfStmts(s) + ) and + index = [0 .. nextCaseStmtPos - caseStmtPos - 2] and + result = pragma[only_bind_into](s).getStmt(caseStmtPos + 1 + index) + ) + } + + private AstNode getFirstCaseBodyElement(Case case) { + result = getCaseBodyElement(case, 0) + or + not exists(getCaseBodyElement(case, 0)) and + exists(Switch s, int i | + fallsThrough(case) and + // fall-through follows AST order, not case control flow order: + s.getCase(i) = case and + result = getFirstCaseBodyElement(s.getCase(i + 1)) + ) + } + + private AstNode getNextCaseBodyElement(AstNode bodyElement) { + exists(Case case, int i | getCaseBodyElement(case, i) = bodyElement | + result = getCaseBodyElement(case, i + 1) + or + not exists(getCaseBodyElement(case, i + 1)) and + exists(Switch s, int j | + fallsThrough(case) and + // fall-through follows AST order, not case control flow order: + s.getCase(j) = case and + result = getFirstCaseBodyElement(s.getCase(j + 1)) + ) + ) + } + /** * Holds if the value of `child` is propagated to `parent`. For example, * the right-hand side of short-circuiting expressions. @@ -1415,87 +1496,6 @@ module Make0 Ast> { ) } - /** - * Gets an integer indicating the control flow order of a case within a - * switch. This is equal to the AST order, except that default cases are - * always last in control flow order, even if some languages allow them - * to appear before other cases in the AST. - */ - private int getCaseControlFlowOrder(Switch s, Case c) { - exists(int pos | s.getCase(pos) = c | - // if a default case is not last in the AST, move it last in the CFG order - if c instanceof DefaultCase and exists(s.getCase(pos + 1)) - then result = strictcount(s.getCase(_)) - else result = pos - ) - } - - private module CaseDenseRankInput implements DenseRankInputSig1 { - class C = Switch; - - class Ranked = Case; - - predicate getRank = getCaseControlFlowOrder/2; - } - - private predicate getRankedCaseCfgOrder = DenseRank1::denseRank/2; - - private int numberOfStmts(Switch s) { result = strictcount(s.getStmt(_)) } - - private predicate caseIndex(Switch s, Case c, int caseIdx, int caseStmtPos) { - c = s.getCase(caseIdx) and - c = s.getStmt(caseStmtPos) - } - - /** - * Gets the body element of `case` at the specified (zero-based) `index`. - * - * This is either unique when the case has a single right-hand side, or it - * is the sequence of statements between this case and the next case. - */ - private AstNode getCaseBodyElement(Case case, int index) { - result = case.getBody() and index = 0 - or - not exists(case.getBody()) and - exists(Switch s, int caseIdx, int caseStmtPos, int nextCaseStmtPos | - caseIndex(pragma[only_bind_into](s), case, caseIdx, caseStmtPos) and - ( - caseIndex(pragma[only_bind_into](s), _, caseIdx + 1, nextCaseStmtPos) - or - not exists(s.getCase(caseIdx + 1)) and - nextCaseStmtPos = numberOfStmts(s) - ) and - index = [0 .. nextCaseStmtPos - caseStmtPos - 2] and - result = pragma[only_bind_into](s).getStmt(caseStmtPos + 1 + index) - ) - } - - private AstNode getFirstCaseBodyElement(Case case) { - result = getCaseBodyElement(case, 0) - or - not exists(getCaseBodyElement(case, 0)) and - exists(Switch s, int i | - fallsThrough(case) and - // fall-through follows AST order, not case control flow order: - s.getCase(i) = case and - result = getFirstCaseBodyElement(s.getCase(i + 1)) - ) - } - - private AstNode getNextCaseBodyElement(AstNode bodyElement) { - exists(Case case, int i | getCaseBodyElement(case, i) = bodyElement | - result = getCaseBodyElement(case, i + 1) - or - not exists(getCaseBodyElement(case, i + 1)) and - exists(Switch s, int j | - fallsThrough(case) and - // fall-through follows AST order, not case control flow order: - s.getCase(j) = case and - result = getFirstCaseBodyElement(s.getCase(j + 1)) - ) - ) - } - pragma[nomagic] private AstNode getParameterPatternOrBodyEntry(Callable c, CallableContextOption ctx, int i) { result = getRankedParameter(c, ctx, i).getPattern() From 247a861d941b71778809c2746e96d83c1319a608 Mon Sep 17 00:00:00 2001 From: Tom Hvitved Date: Wed, 18 Nov 2026 11:32:36 +0100 Subject: [PATCH 2/6] CFG: Propagate values of out case bodies --- shared/controlflow/codeql/controlflow/ControlFlowGraph.qll | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/shared/controlflow/codeql/controlflow/ControlFlowGraph.qll b/shared/controlflow/codeql/controlflow/ControlFlowGraph.qll index 743dff32132c..6d31bf660ad1 100644 --- a/shared/controlflow/codeql/controlflow/ControlFlowGraph.qll +++ b/shared/controlflow/codeql/controlflow/ControlFlowGraph.qll @@ -711,6 +711,9 @@ module Make0 Ast> { parent.(BlockStmt).getLastStmt() = child or parent.(ExprStmt).getExpr() = child + or + getCaseBodyElement(parent.(Switch).getCase(_), _) = child and + not exists(getNextCaseBodyElement(child)) } /** @@ -1970,10 +1973,6 @@ module Make0 Ast> { exists(AstNode caseBodyElement | n1.isAfter(caseBodyElement) and n2.isBefore(getNextCaseBodyElement(caseBodyElement)) - or - n1.isAfter(caseBodyElement) and - not exists(getNextCaseBodyElement(caseBodyElement)) and - n2.isAfter(any(Switch s | getCaseBodyElement(s.getCase(_), _) = caseBodyElement)) ) } From 0109b8e17a5db143bc49db694616fad478424d8e Mon Sep 17 00:00:00 2001 From: Tom Hvitved Date: Wed, 18 Nov 2026 11:33:06 +0100 Subject: [PATCH 3/6] CFG: Allow for unbound `Label` type --- shared/controlflow/codeql/controlflow/ControlFlowGraph.qll | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/shared/controlflow/codeql/controlflow/ControlFlowGraph.qll b/shared/controlflow/codeql/controlflow/ControlFlowGraph.qll index 6d31bf660ad1..95cf1eb7da5d 100644 --- a/shared/controlflow/codeql/controlflow/ControlFlowGraph.qll +++ b/shared/controlflow/codeql/controlflow/ControlFlowGraph.qll @@ -443,8 +443,10 @@ module Make0 Ast> { * A label used for matching jump sources and targets, for example in goto * statements. */ + bindingset[this] class Label { /** Gets a textual representation of this label. */ + bindingset[this] string toString(); } @@ -1273,7 +1275,7 @@ module Make0 Ast> { private newtype TAbruptCompletion = TSimpleAbruptCompletion(AbruptSuccessor t) or - TLabeledAbruptCompletion(JumpSuccessor t, Input1::Label l) + TLabeledAbruptCompletion(JumpSuccessor t, Input1::Label l) { Input1::hasLabel(_, l) } /** * A value indicating an abrupt completion of an AST node in the control From 22d4cab92d90b9598282bc40ce1cff9a1be9a778 Mon Sep 17 00:00:00 2001 From: Tom Hvitved Date: Wed, 18 Nov 2026 11:34:36 +0100 Subject: [PATCH 4/6] CFG: Model `do` loops without conditions as infinite loops --- .../codeql/controlflow/ControlFlowGraph.qll | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/shared/controlflow/codeql/controlflow/ControlFlowGraph.qll b/shared/controlflow/codeql/controlflow/ControlFlowGraph.qll index 95cf1eb7da5d..538e407b688b 100644 --- a/shared/controlflow/codeql/controlflow/ControlFlowGraph.qll +++ b/shared/controlflow/codeql/controlflow/ControlFlowGraph.qll @@ -1703,14 +1703,19 @@ module Make0 Ast> { or not exists(getLoopElse(loopstmt)) and n2.isAfter(loopstmt) ) - or - n1.isAfter(loopstmt.getBody()) and - n2.isAdditional(loopstmt, loopHeaderTag()) ) or exists(LoopStmt loopstmt | + n1.isAfter(loopstmt.getBody()) and + n2.isAdditional(loopstmt, loopHeaderTag()) + or n1.isAfter(getLoopElse(loopstmt)) and n2.isAfter(loopstmt) + or + // a do-loop without a condition behaves like an infinite loop + loopstmt = any(DoStmt do | not exists(do.getCondition())) and + n1.isAdditional(loopstmt, loopHeaderTag()) and + n2.isBefore(loopstmt.getBody()) ) or exists(ForEachStmt foreachstmt | From 0f1d00e6300502474ee24256bfe253f525fc12a4 Mon Sep 17 00:00:00 2001 From: Tom Hvitved Date: Wed, 18 Nov 2026 11:36:30 +0100 Subject: [PATCH 5/6] C#: Update expected test output --- .../controlflow/graph/BasicBlock.expected | 9 ++- .../controlflow/graph/Condition.expected | 22 ++++++-- .../controlflow/graph/Dominance.expected | 56 +++++++++++++++++-- .../graph/EnclosingCallable.expected | 14 ++++- .../controlflow/graph/NodeGraph.expected | 22 +++++--- 5 files changed, 104 insertions(+), 19 deletions(-) diff --git a/csharp/ql/test/library-tests/controlflow/graph/BasicBlock.expected b/csharp/ql/test/library-tests/controlflow/graph/BasicBlock.expected index b955551e55b7..f29e5b51e33b 100644 --- a/csharp/ql/test/library-tests/controlflow/graph/BasicBlock.expected +++ b/csharp/ql/test/library-tests/controlflow/graph/BasicBlock.expected @@ -1083,15 +1083,20 @@ | Switch.cs:123:10:123:12 | Entry | Switch.cs:125:24:125:29 | Boolean b | 8 | | Switch.cs:123:10:123:12 | Normal Exit | Switch.cs:123:10:123:12 | Exit | 2 | | Switch.cs:125:13:125:48 | After ... switch { ... } [false] | Switch.cs:124:5:127:5 | After {...} | 3 | -| Switch.cs:125:13:125:48 | After ... switch { ... } [true] | Switch.cs:126:13:126:19 | return ...; | 3 | | Switch.cs:125:24:125:29 | After Boolean b [match] | Switch.cs:125:34:125:34 | access to local variable b | 3 | -| Switch.cs:125:24:125:29 | After Boolean b [no-match] | Switch.cs:125:42:125:46 | false | 7 | +| Switch.cs:125:24:125:29 | After Boolean b [no-match] | Switch.cs:125:42:125:46 | After false [false] | 8 | +| Switch.cs:125:34:125:34 | After access to local variable b [false] | Switch.cs:125:34:125:34 | After access to local variable b [false] | 1 | +| Switch.cs:125:34:125:34 | After access to local variable b [true] | Switch.cs:126:13:126:19 | return ...; | 4 | | Switch.cs:129:12:129:14 | Entry | Switch.cs:131:28:131:35 | String s | 9 | | Switch.cs:131:16:131:66 | After call to method ToString | Switch.cs:129:12:129:14 | Exit | 4 | | Switch.cs:131:17:131:53 | After ... switch { ... } [non-null] | Switch.cs:131:16:131:66 | call to method ToString | 2 | | Switch.cs:131:17:131:53 | After ... switch { ... } [null] | Switch.cs:131:17:131:53 | After ... switch { ... } [null] | 1 | | Switch.cs:131:28:131:35 | After String s [match] | Switch.cs:131:40:131:40 | access to local variable s | 3 | | Switch.cs:131:28:131:35 | After String s [no-match] | Switch.cs:131:48:131:51 | null | 7 | +| Switch.cs:131:40:131:40 | After access to local variable s [non-null] | Switch.cs:131:40:131:40 | After access to local variable s [non-null] | 1 | +| Switch.cs:131:40:131:40 | After access to local variable s [null] | Switch.cs:131:40:131:40 | After access to local variable s [null] | 1 | +| Switch.cs:131:48:131:51 | After null [non-null] | Switch.cs:131:48:131:51 | After null [non-null] | 1 | +| Switch.cs:131:48:131:51 | After null [null] | Switch.cs:131:48:131:51 | After null [null] | 1 | | Switch.cs:134:9:134:11 | Entry | Switch.cs:139:18:139:18 | 1 | 7 | | Switch.cs:134:9:134:11 | Normal Exit | Switch.cs:134:9:134:11 | Exit | 2 | | Switch.cs:139:18:139:18 | After 1 [match] | Switch.cs:139:21:139:29 | return ...; | 5 | diff --git a/csharp/ql/test/library-tests/controlflow/graph/Condition.expected b/csharp/ql/test/library-tests/controlflow/graph/Condition.expected index 784bf2a58724..e01b52ba1c6b 100644 --- a/csharp/ql/test/library-tests/controlflow/graph/Condition.expected +++ b/csharp/ql/test/library-tests/controlflow/graph/Condition.expected @@ -774,8 +774,20 @@ conditionBlock | Switch.cs:118:18:118:18 | After 2 [match] | Switch.cs:118:25:118:33 | After ... == ... [true] | true | | Switch.cs:123:10:123:12 | Entry | Switch.cs:125:24:125:29 | After Boolean b [match] | true | | Switch.cs:123:10:123:12 | Entry | Switch.cs:125:24:125:29 | After Boolean b [no-match] | false | +| Switch.cs:123:10:123:12 | Entry | Switch.cs:125:34:125:34 | After access to local variable b [false] | true | +| Switch.cs:123:10:123:12 | Entry | Switch.cs:125:34:125:34 | After access to local variable b [true] | true | +| Switch.cs:125:24:125:29 | After Boolean b [match] | Switch.cs:125:34:125:34 | After access to local variable b [false] | false | +| Switch.cs:125:24:125:29 | After Boolean b [match] | Switch.cs:125:34:125:34 | After access to local variable b [true] | true | | Switch.cs:129:12:129:14 | Entry | Switch.cs:131:28:131:35 | After String s [match] | true | | Switch.cs:129:12:129:14 | Entry | Switch.cs:131:28:131:35 | After String s [no-match] | false | +| Switch.cs:129:12:129:14 | Entry | Switch.cs:131:40:131:40 | After access to local variable s [non-null] | true | +| Switch.cs:129:12:129:14 | Entry | Switch.cs:131:40:131:40 | After access to local variable s [null] | true | +| Switch.cs:129:12:129:14 | Entry | Switch.cs:131:48:131:51 | After null [non-null] | false | +| Switch.cs:129:12:129:14 | Entry | Switch.cs:131:48:131:51 | After null [null] | false | +| Switch.cs:131:28:131:35 | After String s [match] | Switch.cs:131:40:131:40 | After access to local variable s [non-null] | false | +| Switch.cs:131:28:131:35 | After String s [match] | Switch.cs:131:40:131:40 | After access to local variable s [null] | true | +| Switch.cs:131:28:131:35 | After String s [no-match] | Switch.cs:131:48:131:51 | After null [non-null] | false | +| Switch.cs:131:28:131:35 | After String s [no-match] | Switch.cs:131:48:131:51 | After null [null] | true | | Switch.cs:134:9:134:11 | Entry | Switch.cs:139:18:139:18 | After 1 [match] | true | | Switch.cs:134:9:134:11 | Entry | Switch.cs:139:18:139:18 | After 1 [no-match] | false | | Switch.cs:134:9:134:11 | Entry | Switch.cs:140:18:140:18 | After 2 [match] | false | @@ -1379,10 +1391,12 @@ conditionFlow | Switch.cs:117:25:117:34 | ... == ... | Switch.cs:117:25:117:34 | After ... == ... [true] | true | | Switch.cs:118:25:118:33 | ... == ... | Switch.cs:118:25:118:33 | After ... == ... [false] | false | | Switch.cs:118:25:118:33 | ... == ... | Switch.cs:118:25:118:33 | After ... == ... [true] | true | -| Switch.cs:125:34:125:34 | access to local variable b | Switch.cs:125:13:125:48 | After ... switch { ... } [false] | false | -| Switch.cs:125:34:125:34 | access to local variable b | Switch.cs:125:13:125:48 | After ... switch { ... } [true] | true | -| Switch.cs:125:42:125:46 | false | Switch.cs:125:13:125:48 | After ... switch { ... } [false] | false | -| Switch.cs:125:42:125:46 | false | Switch.cs:125:13:125:48 | After ... switch { ... } [true] | true | +| Switch.cs:125:34:125:34 | After access to local variable b [false] | Switch.cs:125:13:125:48 | After ... switch { ... } [false] | false | +| Switch.cs:125:34:125:34 | After access to local variable b [true] | Switch.cs:125:13:125:48 | After ... switch { ... } [true] | true | +| Switch.cs:125:34:125:34 | access to local variable b | Switch.cs:125:34:125:34 | After access to local variable b [false] | false | +| Switch.cs:125:34:125:34 | access to local variable b | Switch.cs:125:34:125:34 | After access to local variable b [true] | true | +| Switch.cs:125:42:125:46 | After false [false] | Switch.cs:125:13:125:48 | After ... switch { ... } [false] | false | +| Switch.cs:125:42:125:46 | false | Switch.cs:125:42:125:46 | After false [false] | false | | Switch.cs:157:13:157:13 | access to parameter b | Switch.cs:157:13:157:13 | After access to parameter b [false] | false | | Switch.cs:157:13:157:13 | access to parameter b | Switch.cs:157:13:157:13 | After access to parameter b [true] | true | | TypeAccesses.cs:7:13:7:22 | ... is ... | TypeAccesses.cs:7:13:7:22 | After ... is ... [false] | false | diff --git a/csharp/ql/test/library-tests/controlflow/graph/Dominance.expected b/csharp/ql/test/library-tests/controlflow/graph/Dominance.expected index a5da568e89e5..e59b2fa472ff 100644 --- a/csharp/ql/test/library-tests/controlflow/graph/Dominance.expected +++ b/csharp/ql/test/library-tests/controlflow/graph/Dominance.expected @@ -6112,10 +6112,14 @@ dominance | Switch.cs:125:24:125:34 | ... => ... | Switch.cs:125:24:125:29 | Boolean b | | Switch.cs:125:24:125:34 | After ... => ... [match] | Switch.cs:125:34:125:34 | access to local variable b | | Switch.cs:125:24:125:34 | After ... => ... [no-match] | Switch.cs:125:37:125:46 | ... => ... | +| Switch.cs:125:34:125:34 | After access to local variable b [true] | Switch.cs:125:13:125:48 | After ... switch { ... } [true] | +| Switch.cs:125:34:125:34 | access to local variable b | Switch.cs:125:34:125:34 | After access to local variable b [false] | +| Switch.cs:125:34:125:34 | access to local variable b | Switch.cs:125:34:125:34 | After access to local variable b [true] | | Switch.cs:125:37:125:37 | After _ [match] | Switch.cs:125:37:125:46 | After ... => ... [match] | | Switch.cs:125:37:125:37 | _ | Switch.cs:125:37:125:37 | After _ [match] | | Switch.cs:125:37:125:46 | ... => ... | Switch.cs:125:37:125:37 | _ | | Switch.cs:125:37:125:46 | After ... => ... [match] | Switch.cs:125:42:125:46 | false | +| Switch.cs:125:42:125:46 | false | Switch.cs:125:42:125:46 | After false [false] | | Switch.cs:126:13:126:19 | Before return ...; | Switch.cs:126:13:126:19 | return ...; | | Switch.cs:129:12:129:14 | Entry | Switch.cs:129:23:129:23 | o | | Switch.cs:129:12:129:14 | Normal Exit | Switch.cs:129:12:129:14 | Exit | @@ -6135,10 +6139,14 @@ dominance | Switch.cs:131:28:131:40 | ... => ... | Switch.cs:131:28:131:35 | String s | | Switch.cs:131:28:131:40 | After ... => ... [match] | Switch.cs:131:40:131:40 | access to local variable s | | Switch.cs:131:28:131:40 | After ... => ... [no-match] | Switch.cs:131:43:131:51 | ... => ... | +| Switch.cs:131:40:131:40 | access to local variable s | Switch.cs:131:40:131:40 | After access to local variable s [non-null] | +| Switch.cs:131:40:131:40 | access to local variable s | Switch.cs:131:40:131:40 | After access to local variable s [null] | | Switch.cs:131:43:131:43 | After _ [match] | Switch.cs:131:43:131:51 | After ... => ... [match] | | Switch.cs:131:43:131:43 | _ | Switch.cs:131:43:131:43 | After _ [match] | | Switch.cs:131:43:131:51 | ... => ... | Switch.cs:131:43:131:43 | _ | | Switch.cs:131:43:131:51 | After ... => ... [match] | Switch.cs:131:48:131:51 | null | +| Switch.cs:131:48:131:51 | null | Switch.cs:131:48:131:51 | After null [non-null] | +| Switch.cs:131:48:131:51 | null | Switch.cs:131:48:131:51 | After null [null] | | Switch.cs:134:9:134:11 | Entry | Switch.cs:134:17:134:17 | i | | Switch.cs:134:9:134:11 | Normal Exit | Switch.cs:134:9:134:11 | Exit | | Switch.cs:134:17:134:17 | i | Switch.cs:135:5:142:5 | {...} | @@ -13844,6 +13852,9 @@ postDominance | Switch.cs:125:9:126:19 | if (...) ... | Switch.cs:124:5:127:5 | {...} | | Switch.cs:125:13:125:13 | access to parameter o | Switch.cs:125:13:125:48 | ... switch { ... } | | Switch.cs:125:13:125:48 | ... switch { ... } | Switch.cs:125:9:126:19 | if (...) ... | +| Switch.cs:125:13:125:48 | After ... switch { ... } [false] | Switch.cs:125:34:125:34 | After access to local variable b [false] | +| Switch.cs:125:13:125:48 | After ... switch { ... } [false] | Switch.cs:125:42:125:46 | After false [false] | +| Switch.cs:125:13:125:48 | After ... switch { ... } [true] | Switch.cs:125:34:125:34 | After access to local variable b [true] | | Switch.cs:125:24:125:29 | Boolean b | Switch.cs:125:24:125:34 | ... => ... | | Switch.cs:125:24:125:34 | ... => ... | Switch.cs:125:13:125:13 | access to parameter o | | Switch.cs:125:24:125:34 | After ... => ... [match] | Switch.cs:125:24:125:29 | After Boolean b [match] | @@ -13853,6 +13864,7 @@ postDominance | Switch.cs:125:37:125:37 | _ | Switch.cs:125:37:125:46 | ... => ... | | Switch.cs:125:37:125:46 | ... => ... | Switch.cs:125:24:125:34 | After ... => ... [no-match] | | Switch.cs:125:37:125:46 | After ... => ... [match] | Switch.cs:125:37:125:37 | After _ [match] | +| Switch.cs:125:42:125:46 | After false [false] | Switch.cs:125:42:125:46 | false | | Switch.cs:125:42:125:46 | false | Switch.cs:125:37:125:46 | After ... => ... [match] | | Switch.cs:126:13:126:19 | Before return ...; | Switch.cs:125:13:125:48 | After ... switch { ... } [true] | | Switch.cs:126:13:126:19 | return ...; | Switch.cs:126:13:126:19 | Before return ...; | @@ -13868,6 +13880,10 @@ postDominance | Switch.cs:131:16:131:66 | call to method ToString | Switch.cs:131:17:131:53 | After ... switch { ... } [non-null] | | Switch.cs:131:17:131:17 | access to parameter o | Switch.cs:131:17:131:53 | ... switch { ... } | | Switch.cs:131:17:131:53 | ... switch { ... } | Switch.cs:131:16:131:66 | Before call to method ToString | +| Switch.cs:131:17:131:53 | After ... switch { ... } [non-null] | Switch.cs:131:40:131:40 | After access to local variable s [non-null] | +| Switch.cs:131:17:131:53 | After ... switch { ... } [non-null] | Switch.cs:131:48:131:51 | After null [non-null] | +| Switch.cs:131:17:131:53 | After ... switch { ... } [null] | Switch.cs:131:40:131:40 | After access to local variable s [null] | +| Switch.cs:131:17:131:53 | After ... switch { ... } [null] | Switch.cs:131:48:131:51 | After null [null] | | Switch.cs:131:28:131:35 | String s | Switch.cs:131:28:131:40 | ... => ... | | Switch.cs:131:28:131:40 | ... => ... | Switch.cs:131:17:131:17 | access to parameter o | | Switch.cs:131:28:131:40 | After ... => ... [match] | Switch.cs:131:28:131:35 | After String s [match] | @@ -19067,25 +19083,41 @@ blockDominance | Switch.cs:123:10:123:12 | Entry | Switch.cs:123:10:123:12 | Entry | | Switch.cs:123:10:123:12 | Entry | Switch.cs:123:10:123:12 | Normal Exit | | Switch.cs:123:10:123:12 | Entry | Switch.cs:125:13:125:48 | After ... switch { ... } [false] | -| Switch.cs:123:10:123:12 | Entry | Switch.cs:125:13:125:48 | After ... switch { ... } [true] | | Switch.cs:123:10:123:12 | Entry | Switch.cs:125:24:125:29 | After Boolean b [match] | | Switch.cs:123:10:123:12 | Entry | Switch.cs:125:24:125:29 | After Boolean b [no-match] | +| Switch.cs:123:10:123:12 | Entry | Switch.cs:125:34:125:34 | After access to local variable b [false] | +| Switch.cs:123:10:123:12 | Entry | Switch.cs:125:34:125:34 | After access to local variable b [true] | | Switch.cs:123:10:123:12 | Normal Exit | Switch.cs:123:10:123:12 | Normal Exit | | Switch.cs:125:13:125:48 | After ... switch { ... } [false] | Switch.cs:125:13:125:48 | After ... switch { ... } [false] | -| Switch.cs:125:13:125:48 | After ... switch { ... } [true] | Switch.cs:125:13:125:48 | After ... switch { ... } [true] | | Switch.cs:125:24:125:29 | After Boolean b [match] | Switch.cs:125:24:125:29 | After Boolean b [match] | +| Switch.cs:125:24:125:29 | After Boolean b [match] | Switch.cs:125:34:125:34 | After access to local variable b [false] | +| Switch.cs:125:24:125:29 | After Boolean b [match] | Switch.cs:125:34:125:34 | After access to local variable b [true] | | Switch.cs:125:24:125:29 | After Boolean b [no-match] | Switch.cs:125:24:125:29 | After Boolean b [no-match] | +| Switch.cs:125:34:125:34 | After access to local variable b [false] | Switch.cs:125:34:125:34 | After access to local variable b [false] | +| Switch.cs:125:34:125:34 | After access to local variable b [true] | Switch.cs:125:34:125:34 | After access to local variable b [true] | | Switch.cs:129:12:129:14 | Entry | Switch.cs:129:12:129:14 | Entry | | Switch.cs:129:12:129:14 | Entry | Switch.cs:131:16:131:66 | After call to method ToString | | Switch.cs:129:12:129:14 | Entry | Switch.cs:131:17:131:53 | After ... switch { ... } [non-null] | | Switch.cs:129:12:129:14 | Entry | Switch.cs:131:17:131:53 | After ... switch { ... } [null] | | Switch.cs:129:12:129:14 | Entry | Switch.cs:131:28:131:35 | After String s [match] | | Switch.cs:129:12:129:14 | Entry | Switch.cs:131:28:131:35 | After String s [no-match] | +| Switch.cs:129:12:129:14 | Entry | Switch.cs:131:40:131:40 | After access to local variable s [non-null] | +| Switch.cs:129:12:129:14 | Entry | Switch.cs:131:40:131:40 | After access to local variable s [null] | +| Switch.cs:129:12:129:14 | Entry | Switch.cs:131:48:131:51 | After null [non-null] | +| Switch.cs:129:12:129:14 | Entry | Switch.cs:131:48:131:51 | After null [null] | | Switch.cs:131:16:131:66 | After call to method ToString | Switch.cs:131:16:131:66 | After call to method ToString | | Switch.cs:131:17:131:53 | After ... switch { ... } [non-null] | Switch.cs:131:17:131:53 | After ... switch { ... } [non-null] | | Switch.cs:131:17:131:53 | After ... switch { ... } [null] | Switch.cs:131:17:131:53 | After ... switch { ... } [null] | | Switch.cs:131:28:131:35 | After String s [match] | Switch.cs:131:28:131:35 | After String s [match] | +| Switch.cs:131:28:131:35 | After String s [match] | Switch.cs:131:40:131:40 | After access to local variable s [non-null] | +| Switch.cs:131:28:131:35 | After String s [match] | Switch.cs:131:40:131:40 | After access to local variable s [null] | | Switch.cs:131:28:131:35 | After String s [no-match] | Switch.cs:131:28:131:35 | After String s [no-match] | +| Switch.cs:131:28:131:35 | After String s [no-match] | Switch.cs:131:48:131:51 | After null [non-null] | +| Switch.cs:131:28:131:35 | After String s [no-match] | Switch.cs:131:48:131:51 | After null [null] | +| Switch.cs:131:40:131:40 | After access to local variable s [non-null] | Switch.cs:131:40:131:40 | After access to local variable s [non-null] | +| Switch.cs:131:40:131:40 | After access to local variable s [null] | Switch.cs:131:40:131:40 | After access to local variable s [null] | +| Switch.cs:131:48:131:51 | After null [non-null] | Switch.cs:131:48:131:51 | After null [non-null] | +| Switch.cs:131:48:131:51 | After null [null] | Switch.cs:131:48:131:51 | After null [null] | | Switch.cs:134:9:134:11 | Entry | Switch.cs:134:9:134:11 | Entry | | Switch.cs:134:9:134:11 | Entry | Switch.cs:134:9:134:11 | Normal Exit | | Switch.cs:134:9:134:11 | Entry | Switch.cs:139:18:139:18 | After 1 [match] | @@ -23095,13 +23127,17 @@ postBlockDominance | Switch.cs:123:10:123:12 | Normal Exit | Switch.cs:123:10:123:12 | Entry | | Switch.cs:123:10:123:12 | Normal Exit | Switch.cs:123:10:123:12 | Normal Exit | | Switch.cs:123:10:123:12 | Normal Exit | Switch.cs:125:13:125:48 | After ... switch { ... } [false] | -| Switch.cs:123:10:123:12 | Normal Exit | Switch.cs:125:13:125:48 | After ... switch { ... } [true] | | Switch.cs:123:10:123:12 | Normal Exit | Switch.cs:125:24:125:29 | After Boolean b [match] | | Switch.cs:123:10:123:12 | Normal Exit | Switch.cs:125:24:125:29 | After Boolean b [no-match] | +| Switch.cs:123:10:123:12 | Normal Exit | Switch.cs:125:34:125:34 | After access to local variable b [false] | +| Switch.cs:123:10:123:12 | Normal Exit | Switch.cs:125:34:125:34 | After access to local variable b [true] | | Switch.cs:125:13:125:48 | After ... switch { ... } [false] | Switch.cs:125:13:125:48 | After ... switch { ... } [false] | -| Switch.cs:125:13:125:48 | After ... switch { ... } [true] | Switch.cs:125:13:125:48 | After ... switch { ... } [true] | +| Switch.cs:125:13:125:48 | After ... switch { ... } [false] | Switch.cs:125:24:125:29 | After Boolean b [no-match] | +| Switch.cs:125:13:125:48 | After ... switch { ... } [false] | Switch.cs:125:34:125:34 | After access to local variable b [false] | | Switch.cs:125:24:125:29 | After Boolean b [match] | Switch.cs:125:24:125:29 | After Boolean b [match] | | Switch.cs:125:24:125:29 | After Boolean b [no-match] | Switch.cs:125:24:125:29 | After Boolean b [no-match] | +| Switch.cs:125:34:125:34 | After access to local variable b [false] | Switch.cs:125:34:125:34 | After access to local variable b [false] | +| Switch.cs:125:34:125:34 | After access to local variable b [true] | Switch.cs:125:34:125:34 | After access to local variable b [true] | | Switch.cs:129:12:129:14 | Entry | Switch.cs:129:12:129:14 | Entry | | Switch.cs:131:16:131:66 | After call to method ToString | Switch.cs:129:12:129:14 | Entry | | Switch.cs:131:16:131:66 | After call to method ToString | Switch.cs:131:16:131:66 | After call to method ToString | @@ -23109,10 +23145,22 @@ postBlockDominance | Switch.cs:131:16:131:66 | After call to method ToString | Switch.cs:131:17:131:53 | After ... switch { ... } [null] | | Switch.cs:131:16:131:66 | After call to method ToString | Switch.cs:131:28:131:35 | After String s [match] | | Switch.cs:131:16:131:66 | After call to method ToString | Switch.cs:131:28:131:35 | After String s [no-match] | +| Switch.cs:131:16:131:66 | After call to method ToString | Switch.cs:131:40:131:40 | After access to local variable s [non-null] | +| Switch.cs:131:16:131:66 | After call to method ToString | Switch.cs:131:40:131:40 | After access to local variable s [null] | +| Switch.cs:131:16:131:66 | After call to method ToString | Switch.cs:131:48:131:51 | After null [non-null] | +| Switch.cs:131:16:131:66 | After call to method ToString | Switch.cs:131:48:131:51 | After null [null] | | Switch.cs:131:17:131:53 | After ... switch { ... } [non-null] | Switch.cs:131:17:131:53 | After ... switch { ... } [non-null] | +| Switch.cs:131:17:131:53 | After ... switch { ... } [non-null] | Switch.cs:131:40:131:40 | After access to local variable s [non-null] | +| Switch.cs:131:17:131:53 | After ... switch { ... } [non-null] | Switch.cs:131:48:131:51 | After null [non-null] | | Switch.cs:131:17:131:53 | After ... switch { ... } [null] | Switch.cs:131:17:131:53 | After ... switch { ... } [null] | +| Switch.cs:131:17:131:53 | After ... switch { ... } [null] | Switch.cs:131:40:131:40 | After access to local variable s [null] | +| Switch.cs:131:17:131:53 | After ... switch { ... } [null] | Switch.cs:131:48:131:51 | After null [null] | | Switch.cs:131:28:131:35 | After String s [match] | Switch.cs:131:28:131:35 | After String s [match] | | Switch.cs:131:28:131:35 | After String s [no-match] | Switch.cs:131:28:131:35 | After String s [no-match] | +| Switch.cs:131:40:131:40 | After access to local variable s [non-null] | Switch.cs:131:40:131:40 | After access to local variable s [non-null] | +| Switch.cs:131:40:131:40 | After access to local variable s [null] | Switch.cs:131:40:131:40 | After access to local variable s [null] | +| Switch.cs:131:48:131:51 | After null [non-null] | Switch.cs:131:48:131:51 | After null [non-null] | +| Switch.cs:131:48:131:51 | After null [null] | Switch.cs:131:48:131:51 | After null [null] | | Switch.cs:134:9:134:11 | Entry | Switch.cs:134:9:134:11 | Entry | | Switch.cs:134:9:134:11 | Normal Exit | Switch.cs:134:9:134:11 | Entry | | Switch.cs:134:9:134:11 | Normal Exit | Switch.cs:134:9:134:11 | Normal Exit | diff --git a/csharp/ql/test/library-tests/controlflow/graph/EnclosingCallable.expected b/csharp/ql/test/library-tests/controlflow/graph/EnclosingCallable.expected index 1b41c809f591..ad6503ab19ed 100644 --- a/csharp/ql/test/library-tests/controlflow/graph/EnclosingCallable.expected +++ b/csharp/ql/test/library-tests/controlflow/graph/EnclosingCallable.expected @@ -6574,11 +6574,14 @@ nodeEnclosing | Switch.cs:125:24:125:34 | ... => ... | Switch.cs:123:10:123:12 | M11 | | Switch.cs:125:24:125:34 | After ... => ... [match] | Switch.cs:123:10:123:12 | M11 | | Switch.cs:125:24:125:34 | After ... => ... [no-match] | Switch.cs:123:10:123:12 | M11 | +| Switch.cs:125:34:125:34 | After access to local variable b [false] | Switch.cs:123:10:123:12 | M11 | +| Switch.cs:125:34:125:34 | After access to local variable b [true] | Switch.cs:123:10:123:12 | M11 | | Switch.cs:125:34:125:34 | access to local variable b | Switch.cs:123:10:123:12 | M11 | | Switch.cs:125:37:125:37 | After _ [match] | Switch.cs:123:10:123:12 | M11 | | Switch.cs:125:37:125:37 | _ | Switch.cs:123:10:123:12 | M11 | | Switch.cs:125:37:125:46 | ... => ... | Switch.cs:123:10:123:12 | M11 | | Switch.cs:125:37:125:46 | After ... => ... [match] | Switch.cs:123:10:123:12 | M11 | +| Switch.cs:125:42:125:46 | After false [false] | Switch.cs:123:10:123:12 | M11 | | Switch.cs:125:42:125:46 | false | Switch.cs:123:10:123:12 | M11 | | Switch.cs:126:13:126:19 | Before return ...; | Switch.cs:123:10:123:12 | M11 | | Switch.cs:126:13:126:19 | return ...; | Switch.cs:123:10:123:12 | M11 | @@ -6602,11 +6605,15 @@ nodeEnclosing | Switch.cs:131:28:131:40 | ... => ... | Switch.cs:129:12:129:14 | M12 | | Switch.cs:131:28:131:40 | After ... => ... [match] | Switch.cs:129:12:129:14 | M12 | | Switch.cs:131:28:131:40 | After ... => ... [no-match] | Switch.cs:129:12:129:14 | M12 | +| Switch.cs:131:40:131:40 | After access to local variable s [non-null] | Switch.cs:129:12:129:14 | M12 | +| Switch.cs:131:40:131:40 | After access to local variable s [null] | Switch.cs:129:12:129:14 | M12 | | Switch.cs:131:40:131:40 | access to local variable s | Switch.cs:129:12:129:14 | M12 | | Switch.cs:131:43:131:43 | After _ [match] | Switch.cs:129:12:129:14 | M12 | | Switch.cs:131:43:131:43 | _ | Switch.cs:129:12:129:14 | M12 | | Switch.cs:131:43:131:51 | ... => ... | Switch.cs:129:12:129:14 | M12 | | Switch.cs:131:43:131:51 | After ... => ... [match] | Switch.cs:129:12:129:14 | M12 | +| Switch.cs:131:48:131:51 | After null [non-null] | Switch.cs:129:12:129:14 | M12 | +| Switch.cs:131:48:131:51 | After null [null] | Switch.cs:129:12:129:14 | M12 | | Switch.cs:131:48:131:51 | null | Switch.cs:129:12:129:14 | M12 | | Switch.cs:134:9:134:11 | Entry | Switch.cs:134:9:134:11 | M13 | | Switch.cs:134:9:134:11 | Exit | Switch.cs:134:9:134:11 | M13 | @@ -9473,15 +9480,20 @@ blockEnclosing | Switch.cs:123:10:123:12 | Entry | Switch.cs:123:10:123:12 | M11 | | Switch.cs:123:10:123:12 | Normal Exit | Switch.cs:123:10:123:12 | M11 | | Switch.cs:125:13:125:48 | After ... switch { ... } [false] | Switch.cs:123:10:123:12 | M11 | -| Switch.cs:125:13:125:48 | After ... switch { ... } [true] | Switch.cs:123:10:123:12 | M11 | | Switch.cs:125:24:125:29 | After Boolean b [match] | Switch.cs:123:10:123:12 | M11 | | Switch.cs:125:24:125:29 | After Boolean b [no-match] | Switch.cs:123:10:123:12 | M11 | +| Switch.cs:125:34:125:34 | After access to local variable b [false] | Switch.cs:123:10:123:12 | M11 | +| Switch.cs:125:34:125:34 | After access to local variable b [true] | Switch.cs:123:10:123:12 | M11 | | Switch.cs:129:12:129:14 | Entry | Switch.cs:129:12:129:14 | M12 | | Switch.cs:131:16:131:66 | After call to method ToString | Switch.cs:129:12:129:14 | M12 | | Switch.cs:131:17:131:53 | After ... switch { ... } [non-null] | Switch.cs:129:12:129:14 | M12 | | Switch.cs:131:17:131:53 | After ... switch { ... } [null] | Switch.cs:129:12:129:14 | M12 | | Switch.cs:131:28:131:35 | After String s [match] | Switch.cs:129:12:129:14 | M12 | | Switch.cs:131:28:131:35 | After String s [no-match] | Switch.cs:129:12:129:14 | M12 | +| Switch.cs:131:40:131:40 | After access to local variable s [non-null] | Switch.cs:129:12:129:14 | M12 | +| Switch.cs:131:40:131:40 | After access to local variable s [null] | Switch.cs:129:12:129:14 | M12 | +| Switch.cs:131:48:131:51 | After null [non-null] | Switch.cs:129:12:129:14 | M12 | +| Switch.cs:131:48:131:51 | After null [null] | Switch.cs:129:12:129:14 | M12 | | Switch.cs:134:9:134:11 | Entry | Switch.cs:134:9:134:11 | M13 | | Switch.cs:134:9:134:11 | Normal Exit | Switch.cs:134:9:134:11 | M13 | | Switch.cs:139:18:139:18 | After 1 [match] | Switch.cs:134:9:134:11 | M13 | diff --git a/csharp/ql/test/library-tests/controlflow/graph/NodeGraph.expected b/csharp/ql/test/library-tests/controlflow/graph/NodeGraph.expected index 65f023491b27..d346baeb9593 100644 --- a/csharp/ql/test/library-tests/controlflow/graph/NodeGraph.expected +++ b/csharp/ql/test/library-tests/controlflow/graph/NodeGraph.expected @@ -6696,14 +6696,16 @@ | Switch.cs:125:24:125:34 | ... => ... | Switch.cs:125:24:125:29 | Boolean b | | | Switch.cs:125:24:125:34 | After ... => ... [match] | Switch.cs:125:34:125:34 | access to local variable b | | | Switch.cs:125:24:125:34 | After ... => ... [no-match] | Switch.cs:125:37:125:46 | ... => ... | | -| Switch.cs:125:34:125:34 | access to local variable b | Switch.cs:125:13:125:48 | After ... switch { ... } [false] | false | -| Switch.cs:125:34:125:34 | access to local variable b | Switch.cs:125:13:125:48 | After ... switch { ... } [true] | true | +| Switch.cs:125:34:125:34 | After access to local variable b [false] | Switch.cs:125:13:125:48 | After ... switch { ... } [false] | false | +| Switch.cs:125:34:125:34 | After access to local variable b [true] | Switch.cs:125:13:125:48 | After ... switch { ... } [true] | true | +| Switch.cs:125:34:125:34 | access to local variable b | Switch.cs:125:34:125:34 | After access to local variable b [false] | false | +| Switch.cs:125:34:125:34 | access to local variable b | Switch.cs:125:34:125:34 | After access to local variable b [true] | true | | Switch.cs:125:37:125:37 | After _ [match] | Switch.cs:125:37:125:46 | After ... => ... [match] | match | | Switch.cs:125:37:125:37 | _ | Switch.cs:125:37:125:37 | After _ [match] | match | | Switch.cs:125:37:125:46 | ... => ... | Switch.cs:125:37:125:37 | _ | | | Switch.cs:125:37:125:46 | After ... => ... [match] | Switch.cs:125:42:125:46 | false | | -| Switch.cs:125:42:125:46 | false | Switch.cs:125:13:125:48 | After ... switch { ... } [false] | false | -| Switch.cs:125:42:125:46 | false | Switch.cs:125:13:125:48 | After ... switch { ... } [true] | true | +| Switch.cs:125:42:125:46 | After false [false] | Switch.cs:125:13:125:48 | After ... switch { ... } [false] | false | +| Switch.cs:125:42:125:46 | false | Switch.cs:125:42:125:46 | After false [false] | false | | Switch.cs:126:13:126:19 | Before return ...; | Switch.cs:126:13:126:19 | return ...; | | | Switch.cs:126:13:126:19 | return ...; | Switch.cs:123:10:123:12 | Normal Exit | return | | Switch.cs:129:12:129:14 | Entry | Switch.cs:129:23:129:23 | o | | @@ -6726,14 +6728,18 @@ | Switch.cs:131:28:131:40 | ... => ... | Switch.cs:131:28:131:35 | String s | | | Switch.cs:131:28:131:40 | After ... => ... [match] | Switch.cs:131:40:131:40 | access to local variable s | | | Switch.cs:131:28:131:40 | After ... => ... [no-match] | Switch.cs:131:43:131:51 | ... => ... | | -| Switch.cs:131:40:131:40 | access to local variable s | Switch.cs:131:17:131:53 | After ... switch { ... } [non-null] | non-null | -| Switch.cs:131:40:131:40 | access to local variable s | Switch.cs:131:17:131:53 | After ... switch { ... } [null] | null | +| Switch.cs:131:40:131:40 | After access to local variable s [non-null] | Switch.cs:131:17:131:53 | After ... switch { ... } [non-null] | non-null | +| Switch.cs:131:40:131:40 | After access to local variable s [null] | Switch.cs:131:17:131:53 | After ... switch { ... } [null] | null | +| Switch.cs:131:40:131:40 | access to local variable s | Switch.cs:131:40:131:40 | After access to local variable s [non-null] | non-null | +| Switch.cs:131:40:131:40 | access to local variable s | Switch.cs:131:40:131:40 | After access to local variable s [null] | null | | Switch.cs:131:43:131:43 | After _ [match] | Switch.cs:131:43:131:51 | After ... => ... [match] | match | | Switch.cs:131:43:131:43 | _ | Switch.cs:131:43:131:43 | After _ [match] | match | | Switch.cs:131:43:131:51 | ... => ... | Switch.cs:131:43:131:43 | _ | | | Switch.cs:131:43:131:51 | After ... => ... [match] | Switch.cs:131:48:131:51 | null | | -| Switch.cs:131:48:131:51 | null | Switch.cs:131:17:131:53 | After ... switch { ... } [non-null] | non-null | -| Switch.cs:131:48:131:51 | null | Switch.cs:131:17:131:53 | After ... switch { ... } [null] | null | +| Switch.cs:131:48:131:51 | After null [non-null] | Switch.cs:131:17:131:53 | After ... switch { ... } [non-null] | non-null | +| Switch.cs:131:48:131:51 | After null [null] | Switch.cs:131:17:131:53 | After ... switch { ... } [null] | null | +| Switch.cs:131:48:131:51 | null | Switch.cs:131:48:131:51 | After null [non-null] | non-null | +| Switch.cs:131:48:131:51 | null | Switch.cs:131:48:131:51 | After null [null] | null | | Switch.cs:134:9:134:11 | Entry | Switch.cs:134:17:134:17 | i | | | Switch.cs:134:9:134:11 | Normal Exit | Switch.cs:134:9:134:11 | Exit | | | Switch.cs:134:17:134:17 | i | Switch.cs:135:5:142:5 | {...} | | From 0a735a4c8dd05c22c1afa84a30634ff79fdea7aa Mon Sep 17 00:00:00 2001 From: Tom Hvitved Date: Wed, 18 Nov 2026 11:39:26 +0100 Subject: [PATCH 6/6] Go: Make `Label` an alias for `string` --- go/ql/lib/semmle/go/controlflow/ControlFlowGraphImpl.qll | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/go/ql/lib/semmle/go/controlflow/ControlFlowGraphImpl.qll b/go/ql/lib/semmle/go/controlflow/ControlFlowGraphImpl.qll index 9d73c09a2a75..4a5bc90dc7f1 100644 --- a/go/ql/lib/semmle/go/controlflow/ControlFlowGraphImpl.qll +++ b/go/ql/lib/semmle/go/controlflow/ControlFlowGraphImpl.qll @@ -429,11 +429,7 @@ module CfgImpl { class CallableContext = Void; - class Label extends string { - Label() { this = any(Go::LabeledStmt ls).getLabel() } - - string toString() { result = this } - } + class Label = string; predicate hasLabel(Ast::AstNode n, Label l) { l = n.(Go::LabeledStmt).getLabel()