From e9ce6b0f8f2a0c44fa6c321c330cb7fd4361fb19 Mon Sep 17 00:00:00 2001 From: Tom Hvitved Date: Fri, 20 Nov 2026 15:06:18 +0100 Subject: [PATCH 1/3] C#: Extract defining accesses for pattern variables Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- .../Entities/Expressions/Patterns/Pattern.cs | 4 +- .../Expressions/Patterns/RecursivePattern.cs | 2 +- .../Expressions/VariableDeclaration.cs | 20 +-- .../2026-11-20-pattern-defining-access.md | 4 + .../ql/lib/semmle/code/csharp/Assignable.qll | 6 +- .../ql/lib/semmle/code/csharp/exprs/Expr.qll | 2 +- .../assignables/AssignableAccess.expected | 7 + .../assignables/AssignableDefinition.expected | 14 +- .../controlflow/graph/BasicBlock.expected | 28 ++-- .../controlflow/graph/Condition.expected | 8 +- .../controlflow/graph/Dominance.expected | 142 +++++++++++++----- .../graph/EnclosingCallable.expected | 33 ++++ .../controlflow/graph/EntryElement.expected | 46 ++++-- .../controlflow/graph/NodeGraph.expected | 71 ++++++--- .../library-tests/csharp11/PrintAst.expected | 7 + .../library-tests/csharp7/IsFlow.expected | 23 ++- .../csharp7/LocalTaintFlow.expected | 32 ++-- .../library-tests/csharp7/PrintAst.expected | 23 ++- .../library-tests/csharp8/PrintAst.expected | 51 +++++-- .../csharp8/ispatternflow.expected | 42 ++++-- .../library-tests/csharp8/patterns.expected | 28 ++++ .../ql/test/library-tests/csharp8/patterns.ql | 10 ++ .../csharp8/switchexprcontrolflow.expected | 55 +++++-- .../csharp8/switchstmtctrlflow.expected | 74 ++++++--- .../library-tests/csharp9/PrintAst.expected | 25 ++- .../dataflow/patterns/PatternFlow.expected | 72 ++++++--- 26 files changed, 603 insertions(+), 226 deletions(-) create mode 100644 csharp/ql/lib/change-notes/2026-11-20-pattern-defining-access.md diff --git a/csharp/extractor/Semmle.Extraction.CSharp/Entities/Expressions/Patterns/Pattern.cs b/csharp/extractor/Semmle.Extraction.CSharp/Entities/Expressions/Patterns/Pattern.cs index 70c755b51d5c..af8e112160e5 100644 --- a/csharp/extractor/Semmle.Extraction.CSharp/Entities/Expressions/Patterns/Pattern.cs +++ b/csharp/extractor/Semmle.Extraction.CSharp/Entities/Expressions/Patterns/Pattern.cs @@ -34,7 +34,7 @@ internal static Expression Create(Context cx, PatternSyntax syntax, IExpressionP if (cx.GetModel(syntax).GetDeclaredSymbol(singleDesignation) is ILocalSymbol symbol) { var type = symbol.GetAnnotatedType(); - return VariableDeclaration.Create(cx, symbol, type, declPattern.Type, cx.CreateLocation(syntax.GetLocation()), false, parent, child); + return VariableDeclaration.Create(cx, symbol, type, declPattern.Type, cx.CreateLocation(syntax.GetLocation()), false, parent, child, isPattern: true); } throw new InternalError(singleDesignation, "Unable to get the declared symbol of the declaration pattern designation."); case DiscardDesignationSyntax _: @@ -59,7 +59,7 @@ internal static Expression Create(Context cx, PatternSyntax syntax, IExpressionP if (cx.GetModel(syntax).GetDeclaredSymbol(varDesignation) is ILocalSymbol symbol) { var type = symbol.GetAnnotatedType(); - return VariableDeclaration.Create(cx, symbol, type, null, cx.CreateLocation(syntax.GetLocation()), true, parent, child); + return VariableDeclaration.Create(cx, symbol, type, null, cx.CreateLocation(syntax.GetLocation()), true, parent, child, isPattern: true); } throw new InternalError(varPattern, "Unable to get the declared symbol of the var pattern designation."); diff --git a/csharp/extractor/Semmle.Extraction.CSharp/Entities/Expressions/Patterns/RecursivePattern.cs b/csharp/extractor/Semmle.Extraction.CSharp/Entities/Expressions/Patterns/RecursivePattern.cs index 5e18169ceb14..497db9f17d3b 100644 --- a/csharp/extractor/Semmle.Extraction.CSharp/Entities/Expressions/Patterns/RecursivePattern.cs +++ b/csharp/extractor/Semmle.Extraction.CSharp/Entities/Expressions/Patterns/RecursivePattern.cs @@ -26,7 +26,7 @@ public RecursivePattern(Context cx, RecursivePatternSyntax syntax, IExpressionPa { var type = symbol.GetAnnotatedType(); - VariableDeclaration.Create(cx, symbol, type, null, cx.CreateLocation(syntax.GetLocation()), false, this, 0); + VariableDeclaration.Create(cx, symbol, type, null, cx.CreateLocation(syntax.GetLocation()), false, this, 0, isPattern: true); } if (syntax.PositionalPatternClause is PositionalPatternClauseSyntax posPc) diff --git a/csharp/extractor/Semmle.Extraction.CSharp/Entities/Expressions/VariableDeclaration.cs b/csharp/extractor/Semmle.Extraction.CSharp/Entities/Expressions/VariableDeclaration.cs index 47ecee3e037e..c1135cc2c28f 100644 --- a/csharp/extractor/Semmle.Extraction.CSharp/Entities/Expressions/VariableDeclaration.cs +++ b/csharp/extractor/Semmle.Extraction.CSharp/Entities/Expressions/VariableDeclaration.cs @@ -13,13 +13,15 @@ internal class VariableDeclaration : Expression { private VariableDeclaration(IExpressionInfo info) : base(info) { } - public static VariableDeclaration Create(Context cx, ISymbol symbol, AnnotatedTypeSymbol? type, TypeSyntax? optionalSyntax, Location exprLocation, bool isVar, IExpressionParentEntity parent, int child) + public static VariableDeclaration Create(Context cx, ISymbol symbol, AnnotatedTypeSymbol? type, TypeSyntax? optionalSyntax, Location exprLocation, bool isVar, IExpressionParentEntity parent, int child, bool isPattern = false) { var ret = new VariableDeclaration(new ExpressionInfo(cx, type, exprLocation, ExprKind.LOCAL_VAR_DECL, parent, child, isCompilerGenerated: false, null)); cx.Try(null, null, () => { var l = LocalVariable.Create(cx, symbol); l.PopulateManual(ret, isVar); + if (isPattern) + ret.CreateDefiningAccess(l, type); if (optionalSyntax is not null) TypeMention.Create(cx, optionalSyntax, ret, type); }); @@ -86,10 +88,7 @@ public static Expression CreateParenthesized(Context cx, VarPatternSyntax varPat case SingleVariableDesignationSyntax single: if (cx.GetModel(variable).GetDeclaredSymbol(single) is ILocalSymbol local) { - var decl = Create(cx, variable, local.GetAnnotatedType(), tuple, child0++); - var l = LocalVariable.Create(cx, local); - l.PopulateManual(decl, true); - sub = decl; + sub = Create(cx, local, local.GetAnnotatedType(), null, cx.CreateLocation(single.FixedLocation()), true, tuple, child0++, isPattern: true); } else { @@ -176,10 +175,7 @@ public static VariableDeclaration CreateDeclarator(Context cx, VariableDeclarato if (d.Initializer is not null) { - // Create an access - var access = new Expression(new ExpressionInfo(cx, type, localVar.Location, ExprKind.LOCAL_VARIABLE_ACCESS, ret, 0, isCompilerGenerated: false, null)); - cx.TrapWriter.Writer.expr_access(access, localVar); - + ret.CreateDefiningAccess(localVar, type); Create(cx, d.Initializer.Value, ret, 1); } @@ -188,6 +184,12 @@ public static VariableDeclaration CreateDeclarator(Context cx, VariableDeclarato }); return ret; } + + private void CreateDefiningAccess(LocalVariable localVar, AnnotatedTypeSymbol? type) + { + var access = new Expression(new ExpressionInfo(Context, type, localVar.Location, ExprKind.LOCAL_VARIABLE_ACCESS, this, 0, isCompilerGenerated: false, null)); + Context.TrapWriter.Writer.expr_access(access, localVar); + } } internal static class VariableDeclarations diff --git a/csharp/ql/lib/change-notes/2026-11-20-pattern-defining-access.md b/csharp/ql/lib/change-notes/2026-11-20-pattern-defining-access.md new file mode 100644 index 000000000000..2465e113211a --- /dev/null +++ b/csharp/ql/lib/change-notes/2026-11-20-pattern-defining-access.md @@ -0,0 +1,4 @@ +--- +category: fix +--- +* The C# extractor now records defining accesses for local variables declared in patterns. These accesses are available through `LocalVariableDeclExpr.getAccess()` and are classified as writes. \ No newline at end of file diff --git a/csharp/ql/lib/semmle/code/csharp/Assignable.qll b/csharp/ql/lib/semmle/code/csharp/Assignable.qll index b4014f09f5ce..e42edb257405 100644 --- a/csharp/ql/lib/semmle/code/csharp/Assignable.qll +++ b/csharp/ql/lib/semmle/code/csharp/Assignable.qll @@ -391,6 +391,8 @@ module AssignableInternal { or def = TAddressOfDefinition(any(AddressOfExpr aoe | aoe.getOperand() = result)) or + def = TPatternDefinition(any(LocalVariablePatternDecl decl | decl.getAccess() = result)) + or def = TAssignOperationDefinition(any(AssignOperation ao | ao.getLeftOperand() = result)) } @@ -474,8 +476,8 @@ class AssignableDefinition extends TAssignableDefinition { /** * Gets the access used in the definition of the underlying assignable, - * if any. Local variable declarations and implicit parameter definitions - * are the only definitions without associated accesses. + * if any. For example, an uninitialized local variable declaration or an + * implicit parameter definition has no associated access. */ final AssignableAccess getTargetAccess() { result = getTargetAccess(this) } diff --git a/csharp/ql/lib/semmle/code/csharp/exprs/Expr.qll b/csharp/ql/lib/semmle/code/csharp/exprs/Expr.qll index 53e6d359c212..c3798cc27dd0 100644 --- a/csharp/ql/lib/semmle/code/csharp/exprs/Expr.qll +++ b/csharp/ql/lib/semmle/code/csharp/exprs/Expr.qll @@ -179,7 +179,7 @@ class LocalVariableDeclExpr extends Expr, @local_var_decl_expr { result = "_" } - /** Gets the variable access used in this declaration, if any. */ + /** Gets the defining variable access used in this declaration, if any. */ LocalVariableAccess getAccess() { result = this.getChild(0) or result = this // `out` argument diff --git a/csharp/ql/test/library-tests/assignables/AssignableAccess.expected b/csharp/ql/test/library-tests/assignables/AssignableAccess.expected index 21a02731071b..a6c9a64b2e9c 100644 --- a/csharp/ql/test/library-tests/assignables/AssignableAccess.expected +++ b/csharp/ql/test/library-tests/assignables/AssignableAccess.expected @@ -117,12 +117,19 @@ | Finally.cs:17:16:17:16 | access to local variable i | Finally.cs:7:13:7:13 | i | read | | Patterns.cs:7:16:7:16 | access to local variable o | Patterns.cs:7:16:7:16 | o | write | | Patterns.cs:8:13:8:13 | access to local variable o | Patterns.cs:7:16:7:16 | o | read | +| Patterns.cs:8:22:8:23 | access to local variable i1 | Patterns.cs:8:22:8:23 | i1 | write | | Patterns.cs:10:38:10:39 | access to local variable i1 | Patterns.cs:8:22:8:23 | i1 | read | | Patterns.cs:12:18:12:18 | access to local variable o | Patterns.cs:7:16:7:16 | o | read | +| Patterns.cs:12:30:12:31 | access to local variable s1 | Patterns.cs:12:30:12:31 | s1 | write | | Patterns.cs:14:41:14:42 | access to local variable s1 | Patterns.cs:12:30:12:31 | s1 | read | | Patterns.cs:16:18:16:18 | access to local variable o | Patterns.cs:7:16:7:16 | o | read | +| Patterns.cs:16:27:16:28 | access to local variable v1 | Patterns.cs:16:27:16:28 | v1 | write | | Patterns.cs:20:17:20:17 | access to local variable o | Patterns.cs:7:16:7:16 | o | read | +| Patterns.cs:24:22:24:23 | access to local variable i2 | Patterns.cs:24:22:24:23 | i2 | write | | Patterns.cs:24:30:24:31 | access to local variable i2 | Patterns.cs:24:22:24:23 | i2 | read | | Patterns.cs:25:47:25:48 | access to local variable i2 | Patterns.cs:24:22:24:23 | i2 | read | +| Patterns.cs:27:22:27:23 | access to local variable i3 | Patterns.cs:27:22:27:23 | i3 | write | | Patterns.cs:28:42:28:43 | access to local variable i3 | Patterns.cs:27:22:27:23 | i3 | read | +| Patterns.cs:30:25:30:26 | access to local variable s2 | Patterns.cs:30:25:30:26 | s2 | write | | Patterns.cs:31:45:31:46 | access to local variable s2 | Patterns.cs:30:25:30:26 | s2 | read | +| Patterns.cs:33:22:33:23 | access to local variable v2 | Patterns.cs:33:22:33:23 | v2 | write | diff --git a/csharp/ql/test/library-tests/assignables/AssignableDefinition.expected b/csharp/ql/test/library-tests/assignables/AssignableDefinition.expected index a2f6e34e4ea1..2ca98eb27ffa 100644 --- a/csharp/ql/test/library-tests/assignables/AssignableDefinition.expected +++ b/csharp/ql/test/library-tests/assignables/AssignableDefinition.expected @@ -102,10 +102,10 @@ | Finally.cs:7:13:7:13 | i | Finally.cs:7:13:7:17 | Int32 i = ... | Finally.cs:7:13:7:13 | access to local variable i | Finally.cs:7:17:7:17 | 0 | certain | | Finally.cs:7:13:7:13 | i | Finally.cs:15:13:15:17 | ... = ... | Finally.cs:15:13:15:13 | access to local variable i | Finally.cs:15:17:15:17 | 1 | certain | | Patterns.cs:7:16:7:16 | o | Patterns.cs:7:16:7:23 | Object o = ... | Patterns.cs:7:16:7:16 | access to local variable o | Patterns.cs:7:20:7:23 | null | certain | -| Patterns.cs:8:22:8:23 | i1 | Patterns.cs:8:18:8:23 | Int32 i1 | Patterns.cs:8:18:8:23 | | Patterns.cs:8:13:8:13 | access to local variable o | certain | -| Patterns.cs:12:30:12:31 | s1 | Patterns.cs:12:23:12:31 | String s1 | Patterns.cs:12:23:12:31 | | Patterns.cs:12:18:12:18 | access to local variable o | certain | -| Patterns.cs:16:27:16:28 | v1 | Patterns.cs:16:23:16:28 | Object v1 | Patterns.cs:16:23:16:28 | | Patterns.cs:16:18:16:18 | access to local variable o | certain | -| Patterns.cs:24:22:24:23 | i2 | Patterns.cs:24:18:24:23 | Int32 i2 | Patterns.cs:24:18:24:23 | | Patterns.cs:20:17:20:17 | access to local variable o | certain | -| Patterns.cs:27:22:27:23 | i3 | Patterns.cs:27:18:27:23 | Int32 i3 | Patterns.cs:27:18:27:23 | | Patterns.cs:20:17:20:17 | access to local variable o | certain | -| Patterns.cs:30:25:30:26 | s2 | Patterns.cs:30:18:30:26 | String s2 | Patterns.cs:30:18:30:26 | | Patterns.cs:20:17:20:17 | access to local variable o | certain | -| Patterns.cs:33:22:33:23 | v2 | Patterns.cs:33:18:33:23 | Object v2 | Patterns.cs:33:18:33:23 | | Patterns.cs:20:17:20:17 | access to local variable o | certain | +| Patterns.cs:8:22:8:23 | i1 | Patterns.cs:8:18:8:23 | Int32 i1 | Patterns.cs:8:22:8:23 | access to local variable i1 | Patterns.cs:8:13:8:13 | access to local variable o | certain | +| Patterns.cs:12:30:12:31 | s1 | Patterns.cs:12:23:12:31 | String s1 | Patterns.cs:12:30:12:31 | access to local variable s1 | Patterns.cs:12:18:12:18 | access to local variable o | certain | +| Patterns.cs:16:27:16:28 | v1 | Patterns.cs:16:23:16:28 | Object v1 | Patterns.cs:16:27:16:28 | access to local variable v1 | Patterns.cs:16:18:16:18 | access to local variable o | certain | +| Patterns.cs:24:22:24:23 | i2 | Patterns.cs:24:18:24:23 | Int32 i2 | Patterns.cs:24:22:24:23 | access to local variable i2 | Patterns.cs:20:17:20:17 | access to local variable o | certain | +| Patterns.cs:27:22:27:23 | i3 | Patterns.cs:27:18:27:23 | Int32 i3 | Patterns.cs:27:22:27:23 | access to local variable i3 | Patterns.cs:20:17:20:17 | access to local variable o | certain | +| Patterns.cs:30:25:30:26 | s2 | Patterns.cs:30:18:30:26 | String s2 | Patterns.cs:30:25:30:26 | access to local variable s2 | Patterns.cs:20:17:20:17 | access to local variable o | certain | +| Patterns.cs:33:22:33:23 | v2 | Patterns.cs:33:18:33:23 | Object v2 | Patterns.cs:33:22:33:23 | access to local variable v2 | Patterns.cs:20:17:20:17 | access to local variable o | certain | diff --git a/csharp/ql/test/library-tests/controlflow/graph/BasicBlock.expected b/csharp/ql/test/library-tests/controlflow/graph/BasicBlock.expected index f29e5b51e33b..a7d65f35a4ae 100644 --- a/csharp/ql/test/library-tests/controlflow/graph/BasicBlock.expected +++ b/csharp/ql/test/library-tests/controlflow/graph/BasicBlock.expected @@ -917,25 +917,25 @@ | Patterns.cs:5:10:5:11 | Entry | Patterns.cs:8:13:8:23 | ... is ... | 13 | | Patterns.cs:8:9:18:9 | After if (...) ... | Patterns.cs:22:18:22:22 | "xyz" | 5 | | Patterns.cs:8:13:8:23 | After ... is ... [false] | Patterns.cs:12:18:12:31 | ... is ... | 5 | -| Patterns.cs:8:13:8:23 | [MatchTrue] ... is ... | Patterns.cs:9:9:11:9 | After {...} | 18 | +| Patterns.cs:8:13:8:23 | [MatchTrue] ... is ... | Patterns.cs:9:9:11:9 | After {...} | 21 | | Patterns.cs:12:14:18:9 | After if (...) ... | Patterns.cs:12:14:18:9 | After if (...) ... | 1 | | Patterns.cs:12:18:12:31 | After ... is ... [false] | Patterns.cs:16:18:16:28 | ... is ... | 5 | -| Patterns.cs:12:18:12:31 | [MatchTrue] ... is ... | Patterns.cs:13:9:15:9 | After {...} | 18 | +| Patterns.cs:12:18:12:31 | [MatchTrue] ... is ... | Patterns.cs:13:9:15:9 | After {...} | 21 | | Patterns.cs:16:14:18:9 | After if (...) ... | Patterns.cs:16:14:18:9 | After if (...) ... | 1 | | Patterns.cs:16:18:16:28 | After ... is ... [false] | Patterns.cs:16:18:16:28 | After ... is ... [false] | 1 | -| Patterns.cs:16:18:16:28 | [MatchTrue] ... is ... | Patterns.cs:17:9:18:9 | {...} | 4 | +| Patterns.cs:16:18:16:28 | [MatchTrue] ... is ... | Patterns.cs:17:9:18:9 | {...} | 7 | | Patterns.cs:20:9:38:9 | After switch (...) {...} | Patterns.cs:5:10:5:11 | Exit | 7 | | Patterns.cs:22:18:22:22 | After "xyz" [match] | Patterns.cs:23:17:23:22 | break; | 4 | -| Patterns.cs:22:18:22:22 | After "xyz" [no-match] | Patterns.cs:24:18:24:23 | Int32 i2 | 4 | +| Patterns.cs:22:18:22:22 | After "xyz" [no-match] | Patterns.cs:24:18:24:23 | Int32 i2 | 6 | | Patterns.cs:24:18:24:23 | After Int32 i2 [match] | Patterns.cs:24:30:24:35 | ... > ... | 6 | | Patterns.cs:24:18:24:23 | After Int32 i2 [no-match] | Patterns.cs:24:13:24:36 | After case ...: [no-match] | 2 | | Patterns.cs:24:30:24:35 | After ... > ... [false] | Patterns.cs:24:30:24:35 | After ... > ... [false] | 1 | | Patterns.cs:24:30:24:35 | After ... > ... [true] | Patterns.cs:26:17:26:22 | break; | 16 | -| Patterns.cs:27:13:27:24 | case ...: | Patterns.cs:27:18:27:23 | Int32 i3 | 2 | +| Patterns.cs:27:13:27:24 | case ...: | Patterns.cs:27:18:27:23 | Int32 i3 | 4 | | Patterns.cs:27:18:27:23 | After Int32 i3 [match] | Patterns.cs:29:17:29:22 | break; | 17 | -| Patterns.cs:27:18:27:23 | After Int32 i3 [no-match] | Patterns.cs:30:18:30:26 | String s2 | 4 | +| Patterns.cs:27:18:27:23 | After Int32 i3 [no-match] | Patterns.cs:30:18:30:26 | String s2 | 6 | | Patterns.cs:30:18:30:26 | After String s2 [match] | Patterns.cs:32:17:32:22 | break; | 17 | -| Patterns.cs:30:18:30:26 | After String s2 [no-match] | Patterns.cs:33:18:33:23 | Object v2 | 4 | +| Patterns.cs:30:18:30:26 | After String s2 [no-match] | Patterns.cs:33:18:33:23 | Object v2 | 6 | | Patterns.cs:33:18:33:23 | After Object v2 [match] | Patterns.cs:34:17:34:22 | break; | 4 | | Patterns.cs:33:18:33:23 | After Object v2 [no-match] | Patterns.cs:37:17:37:22 | break; | 12 | | Patterns.cs:47:24:47:25 | Entry | Patterns.cs:48:9:48:20 | ... is ... | 5 | @@ -951,7 +951,7 @@ | Patterns.cs:51:34:51:39 | [MatchTrue] ... is ... | Patterns.cs:51:39:51:39 | 2 | 2 | | Patterns.cs:53:24:53:25 | Entry | Patterns.cs:54:9:54:37 | ... is ... | 5 | | Patterns.cs:54:9:54:37 | After ... is ... | Patterns.cs:53:24:53:25 | Exit | 3 | -| Patterns.cs:54:9:54:37 | [MatchTrue] ... is ... | Patterns.cs:54:14:54:37 | After not ... | 13 | +| Patterns.cs:54:9:54:37 | [MatchTrue] ... is ... | Patterns.cs:54:14:54:37 | After not ... | 16 | | Patterns.cs:56:26:56:27 | Entry | Patterns.cs:60:13:60:17 | not ... | 10 | | Patterns.cs:58:16:62:9 | After ... switch { ... } | Patterns.cs:56:26:56:27 | Exit | 4 | | Patterns.cs:60:13:60:17 | After not ... [match] | Patterns.cs:60:22:60:28 | "not 1" | 3 | @@ -1008,9 +1008,9 @@ | Switch.cs:16:18:16:18 | After 0 [match] | Switch.cs:16:18:16:18 | After 0 [match] | 1 | | Switch.cs:16:18:16:18 | After 0 [no-match] | Switch.cs:18:18:18:21 | null | 4 | | Switch.cs:18:18:18:21 | After null [match] | Switch.cs:19:17:19:29 | goto default; | 4 | -| Switch.cs:18:18:18:21 | After null [no-match] | Switch.cs:20:18:20:22 | Int32 i | 4 | +| Switch.cs:18:18:18:21 | After null [no-match] | Switch.cs:20:18:20:22 | Int32 i | 6 | | Switch.cs:20:18:20:22 | After Int32 i [match] | Switch.cs:21:21:21:29 | ... == ... | 7 | -| Switch.cs:20:18:20:22 | After Int32 i [no-match] | Switch.cs:24:18:24:25 | String s | 4 | +| Switch.cs:20:18:20:22 | After Int32 i [no-match] | Switch.cs:24:18:24:25 | String s | 6 | | Switch.cs:21:21:21:29 | After ... == ... [false] | Switch.cs:23:17:23:28 | goto case ...; | 5 | | Switch.cs:21:21:21:29 | After ... == ... [true] | Switch.cs:22:21:22:27 | return ...; | 3 | | Switch.cs:24:18:24:25 | After String s [match] | Switch.cs:24:32:24:43 | ... > ... | 10 | @@ -1020,7 +1020,7 @@ | Switch.cs:24:32:24:55 | After ... && ... [false] | Switch.cs:24:32:24:55 | After ... && ... [false] | 1 | | Switch.cs:24:48:24:55 | After ... != ... [false] | Switch.cs:24:48:24:55 | After ... != ... [false] | 1 | | Switch.cs:24:48:24:55 | After ... != ... [true] | Switch.cs:26:17:26:23 | return ...; | 10 | -| Switch.cs:27:13:27:39 | case ...: | Switch.cs:27:18:27:25 | Double d | 2 | +| Switch.cs:27:13:27:39 | case ...: | Switch.cs:27:18:27:25 | Double d | 4 | | Switch.cs:27:18:27:25 | After Double d [match] | Switch.cs:27:32:27:38 | call to method Throw | 4 | | Switch.cs:27:18:27:25 | After Double d [no-match] | Switch.cs:30:13:30:20 | default: | 3 | | Switch.cs:30:13:30:20 | After default: [match] | Switch.cs:29:17:29:23 | return ...; | 6 | @@ -1080,14 +1080,14 @@ | Switch.cs:118:18:118:18 | After 2 [no-match] | Switch.cs:118:13:118:34 | After case ...: [no-match] | 2 | | Switch.cs:118:25:118:33 | After ... == ... [false] | Switch.cs:118:25:118:33 | After ... == ... [false] | 1 | | Switch.cs:118:25:118:33 | After ... == ... [true] | Switch.cs:118:36:118:44 | return ...; | 4 | -| Switch.cs:123:10:123:12 | Entry | Switch.cs:125:24:125:29 | Boolean b | 8 | +| Switch.cs:123:10:123:12 | Entry | Switch.cs:125:24:125:29 | Boolean b | 10 | | 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: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 | 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:129:12:129:14 | Entry | Switch.cs:131:28:131:35 | String s | 11 | | 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 | @@ -1131,7 +1131,7 @@ | TypeAccesses.cs:3:10:3:10 | Entry | TypeAccesses.cs:7:13:7:22 | ... is ... | 27 | | TypeAccesses.cs:7:9:7:25 | After if (...) ... | TypeAccesses.cs:3:10:3:10 | Exit | 11 | | TypeAccesses.cs:7:13:7:22 | After ... is ... [false] | TypeAccesses.cs:7:13:7:22 | After ... is ... [false] | 1 | -| TypeAccesses.cs:7:13:7:22 | [MatchTrue] ... is ... | TypeAccesses.cs:7:25:7:25 | ; | 4 | +| TypeAccesses.cs:7:13:7:22 | [MatchTrue] ... is ... | TypeAccesses.cs:7:25:7:25 | ; | 7 | | VarDecls.cs:3:7:3:14 | Entry | VarDecls.cs:3:7:3:14 | Exit | 11 | | VarDecls.cs:5:18:5:19 | Entry | VarDecls.cs:5:18:5:19 | Exit | 37 | | VarDecls.cs:13:12:13:13 | Entry | VarDecls.cs:13:12:13:13 | Exit | 24 | diff --git a/csharp/ql/test/library-tests/controlflow/graph/Condition.expected b/csharp/ql/test/library-tests/controlflow/graph/Condition.expected index e01b52ba1c6b..9d3310a91513 100644 --- a/csharp/ql/test/library-tests/controlflow/graph/Condition.expected +++ b/csharp/ql/test/library-tests/controlflow/graph/Condition.expected @@ -1343,13 +1343,13 @@ conditionFlow | NullCoalescing.cs:11:57:11:58 | access to parameter b3 | NullCoalescing.cs:11:57:11:58 | After access to parameter b3 [true] | true | | Patterns.cs:8:13:8:23 | ... is ... | Patterns.cs:8:13:8:23 | After ... is ... [false] | false | | Patterns.cs:8:13:8:23 | ... is ... | Patterns.cs:8:13:8:23 | [MatchTrue] ... is ... | true | -| Patterns.cs:8:18:8:23 | Int32 i1 | Patterns.cs:8:13:8:23 | After ... is ... [true] | true | +| Patterns.cs:8:18:8:23 | After Int32 i1 | Patterns.cs:8:13:8:23 | After ... is ... [true] | true | | Patterns.cs:12:18:12:31 | ... is ... | Patterns.cs:12:18:12:31 | After ... is ... [false] | false | | Patterns.cs:12:18:12:31 | ... is ... | Patterns.cs:12:18:12:31 | [MatchTrue] ... is ... | true | -| Patterns.cs:12:23:12:31 | String s1 | Patterns.cs:12:18:12:31 | After ... is ... [true] | true | +| Patterns.cs:12:23:12:31 | After String s1 | Patterns.cs:12:18:12:31 | After ... is ... [true] | true | | Patterns.cs:16:18:16:28 | ... is ... | Patterns.cs:16:18:16:28 | After ... is ... [false] | false | | Patterns.cs:16:18:16:28 | ... is ... | Patterns.cs:16:18:16:28 | [MatchTrue] ... is ... | true | -| Patterns.cs:16:23:16:28 | Object v1 | Patterns.cs:16:18:16:28 | After ... is ... [true] | true | +| Patterns.cs:16:23:16:28 | After Object v1 | Patterns.cs:16:18:16:28 | After ... is ... [true] | true | | Patterns.cs:24:30:24:35 | ... > ... | Patterns.cs:24:30:24:35 | After ... > ... [false] | false | | Patterns.cs:24:30:24:35 | ... > ... | Patterns.cs:24:30:24:35 | After ... > ... [true] | true | | Patterns.cs:48:9:48:20 | ... is ... | Patterns.cs:48:9:48:20 | [MatchTrue] ... is ... | true | @@ -1401,7 +1401,7 @@ conditionFlow | 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 | | TypeAccesses.cs:7:13:7:22 | ... is ... | TypeAccesses.cs:7:13:7:22 | [MatchTrue] ... is ... | true | -| TypeAccesses.cs:7:18:7:22 | Int32 j | TypeAccesses.cs:7:13:7:22 | After ... is ... [true] | true | +| TypeAccesses.cs:7:18:7:22 | After Int32 j | TypeAccesses.cs:7:13:7:22 | After ... is ... [true] | true | | VarDecls.cs:25:20:25:20 | access to parameter b | VarDecls.cs:25:20:25:20 | After access to parameter b [false] | false | | VarDecls.cs:25:20:25:20 | access to parameter b | VarDecls.cs:25:20:25:20 | After access to parameter b [true] | true | | cflow.cs:11:13:11:17 | ... > ... | cflow.cs:11:13:11:17 | After ... > ... [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 e59b2fa472ff..92bb463747f9 100644 --- a/csharp/ql/test/library-tests/controlflow/graph/Dominance.expected +++ b/csharp/ql/test/library-tests/controlflow/graph/Dominance.expected @@ -5169,8 +5169,11 @@ dominance | Patterns.cs:8:13:8:23 | After ... is ... [false] | Patterns.cs:12:14:18:9 | if (...) ... | | Patterns.cs:8:13:8:23 | After ... is ... [true] | Patterns.cs:9:9:11:9 | {...} | | Patterns.cs:8:13:8:23 | Before ... is ... | Patterns.cs:8:13:8:13 | access to local variable o | -| Patterns.cs:8:13:8:23 | [MatchTrue] ... is ... | Patterns.cs:8:18:8:23 | Int32 i1 | -| Patterns.cs:8:18:8:23 | Int32 i1 | Patterns.cs:8:13:8:23 | After ... is ... [true] | +| Patterns.cs:8:13:8:23 | [MatchTrue] ... is ... | Patterns.cs:8:18:8:23 | Before Int32 i1 | +| Patterns.cs:8:18:8:23 | After Int32 i1 | Patterns.cs:8:13:8:23 | After ... is ... [true] | +| Patterns.cs:8:18:8:23 | Before Int32 i1 | Patterns.cs:8:22:8:23 | access to local variable i1 | +| Patterns.cs:8:18:8:23 | Int32 i1 | Patterns.cs:8:18:8:23 | After Int32 i1 | +| Patterns.cs:8:22:8:23 | access to local variable i1 | Patterns.cs:8:18:8:23 | Int32 i1 | | Patterns.cs:9:9:11:9 | {...} | Patterns.cs:10:13:10:43 | ...; | | Patterns.cs:10:13:10:42 | After call to method WriteLine | Patterns.cs:10:13:10:43 | After ...; | | Patterns.cs:10:13:10:42 | Before call to method WriteLine | Patterns.cs:10:31:10:41 | Before $"..." | @@ -5192,8 +5195,11 @@ dominance | Patterns.cs:12:18:12:31 | After ... is ... [false] | Patterns.cs:16:14:18:9 | if (...) ... | | Patterns.cs:12:18:12:31 | After ... is ... [true] | Patterns.cs:13:9:15:9 | {...} | | Patterns.cs:12:18:12:31 | Before ... is ... | Patterns.cs:12:18:12:18 | access to local variable o | -| Patterns.cs:12:18:12:31 | [MatchTrue] ... is ... | Patterns.cs:12:23:12:31 | String s1 | -| Patterns.cs:12:23:12:31 | String s1 | Patterns.cs:12:18:12:31 | After ... is ... [true] | +| Patterns.cs:12:18:12:31 | [MatchTrue] ... is ... | Patterns.cs:12:23:12:31 | Before String s1 | +| Patterns.cs:12:23:12:31 | After String s1 | Patterns.cs:12:18:12:31 | After ... is ... [true] | +| Patterns.cs:12:23:12:31 | Before String s1 | Patterns.cs:12:30:12:31 | access to local variable s1 | +| Patterns.cs:12:23:12:31 | String s1 | Patterns.cs:12:23:12:31 | After String s1 | +| Patterns.cs:12:30:12:31 | access to local variable s1 | Patterns.cs:12:23:12:31 | String s1 | | Patterns.cs:13:9:15:9 | {...} | Patterns.cs:14:13:14:46 | ...; | | Patterns.cs:14:13:14:45 | After call to method WriteLine | Patterns.cs:14:13:14:46 | After ...; | | Patterns.cs:14:13:14:45 | Before call to method WriteLine | Patterns.cs:14:31:14:44 | Before $"..." | @@ -5214,8 +5220,11 @@ dominance | Patterns.cs:16:18:16:28 | ... is ... | Patterns.cs:16:18:16:28 | [MatchTrue] ... is ... | | Patterns.cs:16:18:16:28 | After ... is ... [true] | Patterns.cs:17:9:18:9 | {...} | | Patterns.cs:16:18:16:28 | Before ... is ... | Patterns.cs:16:18:16:18 | access to local variable o | -| Patterns.cs:16:18:16:28 | [MatchTrue] ... is ... | Patterns.cs:16:23:16:28 | Object v1 | -| Patterns.cs:16:23:16:28 | Object v1 | Patterns.cs:16:18:16:28 | After ... is ... [true] | +| Patterns.cs:16:18:16:28 | [MatchTrue] ... is ... | Patterns.cs:16:23:16:28 | Before Object v1 | +| Patterns.cs:16:23:16:28 | After Object v1 | Patterns.cs:16:18:16:28 | After ... is ... [true] | +| Patterns.cs:16:23:16:28 | Before Object v1 | Patterns.cs:16:27:16:28 | access to local variable v1 | +| Patterns.cs:16:23:16:28 | Object v1 | Patterns.cs:16:23:16:28 | After Object v1 | +| Patterns.cs:16:27:16:28 | access to local variable v1 | Patterns.cs:16:23:16:28 | Object v1 | | Patterns.cs:20:9:38:9 | After switch (...) {...} | Patterns.cs:40:9:42:9 | switch (...) {...} | | Patterns.cs:20:9:38:9 | switch (...) {...} | Patterns.cs:20:17:20:17 | access to local variable o | | Patterns.cs:20:17:20:17 | access to local variable o | Patterns.cs:22:13:22:23 | case ...: | @@ -5228,11 +5237,13 @@ dominance | Patterns.cs:22:18:22:22 | After "xyz" [no-match] | Patterns.cs:22:13:22:23 | After case ...: [no-match] | | Patterns.cs:23:17:23:22 | Before break; | Patterns.cs:23:17:23:22 | break; | | Patterns.cs:24:13:24:36 | After case ...: [match] | Patterns.cs:24:30:24:35 | Before ... > ... | -| Patterns.cs:24:13:24:36 | case ...: | Patterns.cs:24:18:24:23 | Int32 i2 | +| Patterns.cs:24:13:24:36 | case ...: | Patterns.cs:24:18:24:23 | Before Int32 i2 | | Patterns.cs:24:18:24:23 | After Int32 i2 [match] | Patterns.cs:24:13:24:36 | After case ...: [match] | | Patterns.cs:24:18:24:23 | After Int32 i2 [no-match] | Patterns.cs:24:13:24:36 | After case ...: [no-match] | +| Patterns.cs:24:18:24:23 | Before Int32 i2 | Patterns.cs:24:22:24:23 | access to local variable i2 | | Patterns.cs:24:18:24:23 | Int32 i2 | Patterns.cs:24:18:24:23 | After Int32 i2 [match] | | Patterns.cs:24:18:24:23 | Int32 i2 | Patterns.cs:24:18:24:23 | After Int32 i2 [no-match] | +| Patterns.cs:24:22:24:23 | access to local variable i2 | Patterns.cs:24:18:24:23 | Int32 i2 | | Patterns.cs:24:30:24:31 | access to local variable i2 | Patterns.cs:24:35:24:35 | 0 | | Patterns.cs:24:30:24:35 | ... > ... | Patterns.cs:24:30:24:35 | After ... > ... [false] | | Patterns.cs:24:30:24:35 | ... > ... | Patterns.cs:24:30:24:35 | After ... > ... [true] | @@ -5255,11 +5266,13 @@ dominance | Patterns.cs:26:17:26:22 | Before break; | Patterns.cs:26:17:26:22 | break; | | Patterns.cs:27:13:27:24 | After case ...: [match] | Patterns.cs:28:17:28:47 | ...; | | Patterns.cs:27:13:27:24 | After case ...: [no-match] | Patterns.cs:30:13:30:27 | case ...: | -| Patterns.cs:27:13:27:24 | case ...: | Patterns.cs:27:18:27:23 | Int32 i3 | +| Patterns.cs:27:13:27:24 | case ...: | Patterns.cs:27:18:27:23 | Before Int32 i3 | | Patterns.cs:27:18:27:23 | After Int32 i3 [match] | Patterns.cs:27:13:27:24 | After case ...: [match] | | Patterns.cs:27:18:27:23 | After Int32 i3 [no-match] | Patterns.cs:27:13:27:24 | After case ...: [no-match] | +| Patterns.cs:27:18:27:23 | Before Int32 i3 | Patterns.cs:27:22:27:23 | access to local variable i3 | | Patterns.cs:27:18:27:23 | Int32 i3 | Patterns.cs:27:18:27:23 | After Int32 i3 [match] | | Patterns.cs:27:18:27:23 | Int32 i3 | Patterns.cs:27:18:27:23 | After Int32 i3 [no-match] | +| Patterns.cs:27:22:27:23 | access to local variable i3 | Patterns.cs:27:18:27:23 | Int32 i3 | | Patterns.cs:28:17:28:46 | After call to method WriteLine | Patterns.cs:28:17:28:47 | After ...; | | Patterns.cs:28:17:28:46 | Before call to method WriteLine | Patterns.cs:28:35:28:45 | Before $"..." | | Patterns.cs:28:17:28:46 | call to method WriteLine | Patterns.cs:28:17:28:46 | After call to method WriteLine | @@ -5276,11 +5289,13 @@ dominance | Patterns.cs:29:17:29:22 | Before break; | Patterns.cs:29:17:29:22 | break; | | Patterns.cs:30:13:30:27 | After case ...: [match] | Patterns.cs:31:17:31:50 | ...; | | Patterns.cs:30:13:30:27 | After case ...: [no-match] | Patterns.cs:33:13:33:24 | case ...: | -| Patterns.cs:30:13:30:27 | case ...: | Patterns.cs:30:18:30:26 | String s2 | +| Patterns.cs:30:13:30:27 | case ...: | Patterns.cs:30:18:30:26 | Before String s2 | | Patterns.cs:30:18:30:26 | After String s2 [match] | Patterns.cs:30:13:30:27 | After case ...: [match] | | Patterns.cs:30:18:30:26 | After String s2 [no-match] | Patterns.cs:30:13:30:27 | After case ...: [no-match] | +| Patterns.cs:30:18:30:26 | Before String s2 | Patterns.cs:30:25:30:26 | access to local variable s2 | | Patterns.cs:30:18:30:26 | String s2 | Patterns.cs:30:18:30:26 | After String s2 [match] | | Patterns.cs:30:18:30:26 | String s2 | Patterns.cs:30:18:30:26 | After String s2 [no-match] | +| Patterns.cs:30:25:30:26 | access to local variable s2 | Patterns.cs:30:18:30:26 | String s2 | | Patterns.cs:31:17:31:49 | After call to method WriteLine | Patterns.cs:31:17:31:50 | After ...; | | Patterns.cs:31:17:31:49 | Before call to method WriteLine | Patterns.cs:31:35:31:48 | Before $"..." | | Patterns.cs:31:17:31:49 | call to method WriteLine | Patterns.cs:31:17:31:49 | After call to method WriteLine | @@ -5297,11 +5312,13 @@ dominance | Patterns.cs:32:17:32:22 | Before break; | Patterns.cs:32:17:32:22 | break; | | Patterns.cs:33:13:33:24 | After case ...: [match] | Patterns.cs:34:17:34:22 | Before break; | | Patterns.cs:33:13:33:24 | After case ...: [no-match] | Patterns.cs:35:13:35:20 | default: | -| Patterns.cs:33:13:33:24 | case ...: | Patterns.cs:33:18:33:23 | Object v2 | +| Patterns.cs:33:13:33:24 | case ...: | Patterns.cs:33:18:33:23 | Before Object v2 | | Patterns.cs:33:18:33:23 | After Object v2 [match] | Patterns.cs:33:13:33:24 | After case ...: [match] | | Patterns.cs:33:18:33:23 | After Object v2 [no-match] | Patterns.cs:33:13:33:24 | After case ...: [no-match] | +| Patterns.cs:33:18:33:23 | Before Object v2 | Patterns.cs:33:22:33:23 | access to local variable v2 | | Patterns.cs:33:18:33:23 | Object v2 | Patterns.cs:33:18:33:23 | After Object v2 [match] | | Patterns.cs:33:18:33:23 | Object v2 | Patterns.cs:33:18:33:23 | After Object v2 [no-match] | +| Patterns.cs:33:22:33:23 | access to local variable v2 | Patterns.cs:33:18:33:23 | Object v2 | | Patterns.cs:34:17:34:22 | Before break; | Patterns.cs:34:17:34:22 | break; | | Patterns.cs:35:13:35:20 | After default: [match] | Patterns.cs:36:17:36:52 | ...; | | Patterns.cs:35:13:35:20 | default: | Patterns.cs:35:13:35:20 | After default: [match] | @@ -5365,14 +5382,17 @@ dominance | Patterns.cs:54:14:54:37 | Before not ... | Patterns.cs:54:18:54:37 | Before { ... } | | Patterns.cs:54:14:54:37 | not ... | Patterns.cs:54:14:54:37 | After not ... | | Patterns.cs:54:18:54:25 | access to type Patterns | Patterns.cs:54:27:54:35 | Before { ... } | +| Patterns.cs:54:18:54:37 | After Patterns u | Patterns.cs:54:18:54:25 | access to type Patterns | | Patterns.cs:54:18:54:37 | After { ... } | Patterns.cs:54:14:54:37 | not ... | -| Patterns.cs:54:18:54:37 | Before { ... } | Patterns.cs:54:18:54:37 | Patterns u | -| Patterns.cs:54:18:54:37 | Patterns u | Patterns.cs:54:18:54:25 | access to type Patterns | +| Patterns.cs:54:18:54:37 | Before Patterns u | Patterns.cs:54:37:54:37 | access to local variable u | +| Patterns.cs:54:18:54:37 | Before { ... } | Patterns.cs:54:18:54:37 | Before Patterns u | +| Patterns.cs:54:18:54:37 | Patterns u | Patterns.cs:54:18:54:37 | After Patterns u | | Patterns.cs:54:18:54:37 | { ... } | Patterns.cs:54:18:54:37 | After { ... } | | Patterns.cs:54:27:54:35 | After { ... } | Patterns.cs:54:18:54:37 | { ... } | | Patterns.cs:54:27:54:35 | Before { ... } | Patterns.cs:54:33:54:33 | 1 | | Patterns.cs:54:27:54:35 | { ... } | Patterns.cs:54:27:54:35 | After { ... } | | Patterns.cs:54:33:54:33 | 1 | Patterns.cs:54:27:54:35 | { ... } | +| Patterns.cs:54:37:54:37 | access to local variable u | Patterns.cs:54:18:54:37 | Patterns u | | Patterns.cs:56:26:56:27 | Entry | Patterns.cs:56:33:56:33 | i | | Patterns.cs:56:26:56:27 | Normal Exit | Patterns.cs:56:26:56:27 | Exit | | Patterns.cs:56:33:56:33 | i | Patterns.cs:57:5:63:5 | {...} | @@ -5809,11 +5829,13 @@ dominance | Switch.cs:19:17:19:29 | Before goto default; | Switch.cs:19:17:19:29 | goto default; | | Switch.cs:20:13:20:23 | After case ...: [match] | Switch.cs:21:17:22:27 | if (...) ... | | Switch.cs:20:13:20:23 | After case ...: [no-match] | Switch.cs:24:13:24:56 | case ...: | -| Switch.cs:20:13:20:23 | case ...: | Switch.cs:20:18:20:22 | Int32 i | +| Switch.cs:20:13:20:23 | case ...: | Switch.cs:20:18:20:22 | Before Int32 i | | Switch.cs:20:18:20:22 | After Int32 i [match] | Switch.cs:20:13:20:23 | After case ...: [match] | | Switch.cs:20:18:20:22 | After Int32 i [no-match] | Switch.cs:20:13:20:23 | After case ...: [no-match] | +| Switch.cs:20:18:20:22 | Before Int32 i | Switch.cs:20:22:20:22 | access to local variable i | | Switch.cs:20:18:20:22 | Int32 i | Switch.cs:20:18:20:22 | After Int32 i [match] | | Switch.cs:20:18:20:22 | Int32 i | Switch.cs:20:18:20:22 | After Int32 i [no-match] | +| Switch.cs:20:22:20:22 | access to local variable i | Switch.cs:20:18:20:22 | Int32 i | | Switch.cs:21:17:22:27 | After if (...) ... | Switch.cs:23:17:23:28 | Before goto case ...; | | Switch.cs:21:17:22:27 | if (...) ... | Switch.cs:21:21:21:29 | Before ... == ... | | Switch.cs:21:21:21:21 | access to parameter o | Switch.cs:21:26:21:29 | null | @@ -5827,11 +5849,13 @@ dominance | Switch.cs:23:17:23:28 | Before goto case ...; | Switch.cs:23:27:23:27 | 0 | | Switch.cs:23:27:23:27 | 0 | Switch.cs:23:17:23:28 | goto case ...; | | Switch.cs:24:13:24:56 | After case ...: [match] | Switch.cs:24:32:24:55 | ... && ... | -| Switch.cs:24:13:24:56 | case ...: | Switch.cs:24:18:24:25 | String s | +| Switch.cs:24:13:24:56 | case ...: | Switch.cs:24:18:24:25 | Before String s | | Switch.cs:24:18:24:25 | After String s [match] | Switch.cs:24:13:24:56 | After case ...: [match] | | Switch.cs:24:18:24:25 | After String s [no-match] | Switch.cs:24:13:24:56 | After case ...: [no-match] | +| Switch.cs:24:18:24:25 | Before String s | Switch.cs:24:25:24:25 | access to local variable s | | Switch.cs:24:18:24:25 | String s | Switch.cs:24:18:24:25 | After String s [match] | | Switch.cs:24:18:24:25 | String s | Switch.cs:24:18:24:25 | After String s [no-match] | +| Switch.cs:24:25:24:25 | access to local variable s | Switch.cs:24:18:24:25 | String s | | Switch.cs:24:32:24:32 | access to local variable s | Switch.cs:24:32:24:39 | access to property Length | | Switch.cs:24:32:24:39 | After access to property Length | Switch.cs:24:43:24:43 | 0 | | Switch.cs:24:32:24:39 | Before access to property Length | Switch.cs:24:32:24:32 | access to local variable s | @@ -5858,11 +5882,13 @@ dominance | Switch.cs:26:17:26:23 | Before return ...; | Switch.cs:26:17:26:23 | return ...; | | Switch.cs:27:13:27:39 | After case ...: [match] | Switch.cs:27:32:27:38 | Before call to method Throw | | Switch.cs:27:13:27:39 | After case ...: [no-match] | Switch.cs:30:13:30:20 | default: | -| Switch.cs:27:13:27:39 | case ...: | Switch.cs:27:18:27:25 | Double d | +| Switch.cs:27:13:27:39 | case ...: | Switch.cs:27:18:27:25 | Before Double d | | Switch.cs:27:18:27:25 | After Double d [match] | Switch.cs:27:13:27:39 | After case ...: [match] | | Switch.cs:27:18:27:25 | After Double d [no-match] | Switch.cs:27:13:27:39 | After case ...: [no-match] | +| Switch.cs:27:18:27:25 | Before Double d | Switch.cs:27:25:27:25 | access to local variable d | | Switch.cs:27:18:27:25 | Double d | Switch.cs:27:18:27:25 | After Double d [match] | | Switch.cs:27:18:27:25 | Double d | Switch.cs:27:18:27:25 | After Double d [no-match] | +| Switch.cs:27:25:27:25 | access to local variable d | Switch.cs:27:18:27:25 | Double d | | Switch.cs:27:32:27:38 | Before call to method Throw | Switch.cs:27:32:27:38 | call to method Throw | | Switch.cs:28:13:28:17 | Label: | Switch.cs:29:17:29:23 | Before return ...; | | Switch.cs:29:17:29:23 | Before return ...; | Switch.cs:29:17:29:23 | return ...; | @@ -6107,11 +6133,13 @@ dominance | Switch.cs:125:13:125:48 | After ... switch { ... } [true] | Switch.cs:126:13:126:19 | Before return ...; | | Switch.cs:125:24:125:29 | After Boolean b [match] | Switch.cs:125:24:125:34 | After ... => ... [match] | | Switch.cs:125:24:125:29 | After Boolean b [no-match] | Switch.cs:125:24:125:34 | After ... => ... [no-match] | +| Switch.cs:125:24:125:29 | Before Boolean b | Switch.cs:125:29:125:29 | access to local variable b | | Switch.cs:125:24:125:29 | Boolean b | Switch.cs:125:24:125:29 | After Boolean b [match] | | Switch.cs:125:24:125:29 | Boolean b | Switch.cs:125:24:125:29 | After Boolean b [no-match] | -| Switch.cs:125:24:125:34 | ... => ... | Switch.cs:125:24:125:29 | Boolean b | +| Switch.cs:125:24:125:34 | ... => ... | Switch.cs:125:24:125:29 | Before 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:29:125:29 | access to local variable b | Switch.cs:125:24:125:29 | Boolean b | | 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] | @@ -6134,11 +6162,13 @@ dominance | Switch.cs:131:17:131:53 | After ... switch { ... } [non-null] | Switch.cs:131:16:131:66 | call to method ToString | | Switch.cs:131:28:131:35 | After String s [match] | Switch.cs:131:28:131:40 | After ... => ... [match] | | Switch.cs:131:28:131:35 | After String s [no-match] | Switch.cs:131:28:131:40 | After ... => ... [no-match] | +| Switch.cs:131:28:131:35 | Before String s | Switch.cs:131:35:131:35 | access to local variable s | | Switch.cs:131:28:131:35 | String s | Switch.cs:131:28:131:35 | After String s [match] | | Switch.cs:131:28:131:35 | String s | Switch.cs:131:28:131:35 | After String s [no-match] | -| Switch.cs:131:28:131:40 | ... => ... | Switch.cs:131:28:131:35 | String s | +| Switch.cs:131:28:131:40 | ... => ... | Switch.cs:131:28:131:35 | Before 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:35:131:35 | access to local variable s | Switch.cs:131:28:131:35 | String s | | 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] | @@ -6358,8 +6388,11 @@ dominance | TypeAccesses.cs:7:13:7:22 | ... is ... | TypeAccesses.cs:7:13:7:22 | [MatchTrue] ... is ... | | TypeAccesses.cs:7:13:7:22 | After ... is ... [true] | TypeAccesses.cs:7:25:7:25 | ; | | TypeAccesses.cs:7:13:7:22 | Before ... is ... | TypeAccesses.cs:7:13:7:13 | access to parameter o | -| TypeAccesses.cs:7:13:7:22 | [MatchTrue] ... is ... | TypeAccesses.cs:7:18:7:22 | Int32 j | -| TypeAccesses.cs:7:18:7:22 | Int32 j | TypeAccesses.cs:7:13:7:22 | After ... is ... [true] | +| TypeAccesses.cs:7:13:7:22 | [MatchTrue] ... is ... | TypeAccesses.cs:7:18:7:22 | Before Int32 j | +| TypeAccesses.cs:7:18:7:22 | After Int32 j | TypeAccesses.cs:7:13:7:22 | After ... is ... [true] | +| TypeAccesses.cs:7:18:7:22 | Before Int32 j | TypeAccesses.cs:7:22:7:22 | access to local variable j | +| TypeAccesses.cs:7:18:7:22 | Int32 j | TypeAccesses.cs:7:18:7:22 | After Int32 j | +| TypeAccesses.cs:7:22:7:22 | access to local variable j | TypeAccesses.cs:7:18:7:22 | Int32 j | | TypeAccesses.cs:8:9:8:28 | ... ...; | TypeAccesses.cs:8:13:8:27 | Before Type t = ... | | TypeAccesses.cs:8:9:8:28 | After ... ...; | TypeAccesses.cs:4:5:9:5 | After {...} | | TypeAccesses.cs:8:13:8:13 | access to local variable t | TypeAccesses.cs:8:17:8:27 | typeof(...) | @@ -12933,9 +12966,12 @@ postDominance | Patterns.cs:8:9:18:9 | if (...) ... | Patterns.cs:7:9:7:24 | After ... ...; | | Patterns.cs:8:13:8:13 | access to local variable o | Patterns.cs:8:13:8:23 | Before ... is ... | | Patterns.cs:8:13:8:23 | ... is ... | Patterns.cs:8:13:8:13 | access to local variable o | -| Patterns.cs:8:13:8:23 | After ... is ... [true] | Patterns.cs:8:18:8:23 | Int32 i1 | +| Patterns.cs:8:13:8:23 | After ... is ... [true] | Patterns.cs:8:18:8:23 | After Int32 i1 | | Patterns.cs:8:13:8:23 | Before ... is ... | Patterns.cs:8:9:18:9 | if (...) ... | -| Patterns.cs:8:18:8:23 | Int32 i1 | Patterns.cs:8:13:8:23 | [MatchTrue] ... is ... | +| Patterns.cs:8:18:8:23 | After Int32 i1 | Patterns.cs:8:18:8:23 | Int32 i1 | +| Patterns.cs:8:18:8:23 | Before Int32 i1 | Patterns.cs:8:13:8:23 | [MatchTrue] ... is ... | +| Patterns.cs:8:18:8:23 | Int32 i1 | Patterns.cs:8:22:8:23 | access to local variable i1 | +| Patterns.cs:8:22:8:23 | access to local variable i1 | Patterns.cs:8:18:8:23 | Before Int32 i1 | | Patterns.cs:9:9:11:9 | After {...} | Patterns.cs:10:13:10:43 | After ...; | | Patterns.cs:9:9:11:9 | {...} | Patterns.cs:8:13:8:23 | After ... is ... [true] | | Patterns.cs:10:13:10:42 | After call to method WriteLine | Patterns.cs:10:13:10:42 | call to method WriteLine | @@ -12956,9 +12992,12 @@ postDominance | Patterns.cs:12:14:18:9 | if (...) ... | Patterns.cs:8:13:8:23 | After ... is ... [false] | | Patterns.cs:12:18:12:18 | access to local variable o | Patterns.cs:12:18:12:31 | Before ... is ... | | Patterns.cs:12:18:12:31 | ... is ... | Patterns.cs:12:18:12:18 | access to local variable o | -| Patterns.cs:12:18:12:31 | After ... is ... [true] | Patterns.cs:12:23:12:31 | String s1 | +| Patterns.cs:12:18:12:31 | After ... is ... [true] | Patterns.cs:12:23:12:31 | After String s1 | | Patterns.cs:12:18:12:31 | Before ... is ... | Patterns.cs:12:14:18:9 | if (...) ... | -| Patterns.cs:12:23:12:31 | String s1 | Patterns.cs:12:18:12:31 | [MatchTrue] ... is ... | +| Patterns.cs:12:23:12:31 | After String s1 | Patterns.cs:12:23:12:31 | String s1 | +| Patterns.cs:12:23:12:31 | Before String s1 | Patterns.cs:12:18:12:31 | [MatchTrue] ... is ... | +| Patterns.cs:12:23:12:31 | String s1 | Patterns.cs:12:30:12:31 | access to local variable s1 | +| Patterns.cs:12:30:12:31 | access to local variable s1 | Patterns.cs:12:23:12:31 | Before String s1 | | Patterns.cs:13:9:15:9 | After {...} | Patterns.cs:14:13:14:46 | After ...; | | Patterns.cs:13:9:15:9 | {...} | Patterns.cs:12:18:12:31 | After ... is ... [true] | | Patterns.cs:14:13:14:45 | After call to method WriteLine | Patterns.cs:14:13:14:45 | call to method WriteLine | @@ -12979,9 +13018,12 @@ postDominance | Patterns.cs:16:14:18:9 | if (...) ... | Patterns.cs:12:18:12:31 | After ... is ... [false] | | Patterns.cs:16:18:16:18 | access to local variable o | Patterns.cs:16:18:16:28 | Before ... is ... | | Patterns.cs:16:18:16:28 | ... is ... | Patterns.cs:16:18:16:18 | access to local variable o | -| Patterns.cs:16:18:16:28 | After ... is ... [true] | Patterns.cs:16:23:16:28 | Object v1 | +| Patterns.cs:16:18:16:28 | After ... is ... [true] | Patterns.cs:16:23:16:28 | After Object v1 | | Patterns.cs:16:18:16:28 | Before ... is ... | Patterns.cs:16:14:18:9 | if (...) ... | -| Patterns.cs:16:23:16:28 | Object v1 | Patterns.cs:16:18:16:28 | [MatchTrue] ... is ... | +| Patterns.cs:16:23:16:28 | After Object v1 | Patterns.cs:16:23:16:28 | Object v1 | +| Patterns.cs:16:23:16:28 | Before Object v1 | Patterns.cs:16:18:16:28 | [MatchTrue] ... is ... | +| Patterns.cs:16:23:16:28 | Object v1 | Patterns.cs:16:27:16:28 | access to local variable v1 | +| Patterns.cs:16:27:16:28 | access to local variable v1 | Patterns.cs:16:23:16:28 | Before Object v1 | | Patterns.cs:17:9:18:9 | {...} | Patterns.cs:16:18:16:28 | After ... is ... [true] | | Patterns.cs:20:9:38:9 | After switch (...) {...} | Patterns.cs:23:17:23:22 | break; | | Patterns.cs:20:9:38:9 | After switch (...) {...} | Patterns.cs:26:17:26:22 | break; | @@ -13000,7 +13042,9 @@ postDominance | Patterns.cs:24:13:24:36 | After case ...: [match] | Patterns.cs:24:18:24:23 | After Int32 i2 [match] | | Patterns.cs:24:13:24:36 | After case ...: [no-match] | Patterns.cs:24:18:24:23 | After Int32 i2 [no-match] | | Patterns.cs:24:13:24:36 | case ...: | Patterns.cs:22:13:22:23 | After case ...: [no-match] | -| Patterns.cs:24:18:24:23 | Int32 i2 | Patterns.cs:24:13:24:36 | case ...: | +| Patterns.cs:24:18:24:23 | Before Int32 i2 | Patterns.cs:24:13:24:36 | case ...: | +| Patterns.cs:24:18:24:23 | Int32 i2 | Patterns.cs:24:22:24:23 | access to local variable i2 | +| Patterns.cs:24:22:24:23 | access to local variable i2 | Patterns.cs:24:18:24:23 | Before Int32 i2 | | Patterns.cs:24:30:24:31 | access to local variable i2 | Patterns.cs:24:30:24:35 | Before ... > ... | | Patterns.cs:24:30:24:35 | ... > ... | Patterns.cs:24:35:24:35 | 0 | | Patterns.cs:24:30:24:35 | Before ... > ... | Patterns.cs:24:13:24:36 | After case ...: [match] | @@ -13024,7 +13068,9 @@ postDominance | Patterns.cs:27:13:27:24 | After case ...: [no-match] | Patterns.cs:27:18:27:23 | After Int32 i3 [no-match] | | Patterns.cs:27:13:27:24 | case ...: | Patterns.cs:24:13:24:36 | After case ...: [no-match] | | Patterns.cs:27:13:27:24 | case ...: | Patterns.cs:24:30:24:35 | After ... > ... [false] | -| Patterns.cs:27:18:27:23 | Int32 i3 | Patterns.cs:27:13:27:24 | case ...: | +| Patterns.cs:27:18:27:23 | Before Int32 i3 | Patterns.cs:27:13:27:24 | case ...: | +| Patterns.cs:27:18:27:23 | Int32 i3 | Patterns.cs:27:22:27:23 | access to local variable i3 | +| Patterns.cs:27:22:27:23 | access to local variable i3 | Patterns.cs:27:18:27:23 | Before Int32 i3 | | Patterns.cs:28:17:28:46 | After call to method WriteLine | Patterns.cs:28:17:28:46 | call to method WriteLine | | Patterns.cs:28:17:28:46 | Before call to method WriteLine | Patterns.cs:28:17:28:47 | ...; | | Patterns.cs:28:17:28:46 | call to method WriteLine | Patterns.cs:28:35:28:45 | After $"..." | @@ -13043,7 +13089,9 @@ postDominance | Patterns.cs:30:13:30:27 | After case ...: [match] | Patterns.cs:30:18:30:26 | After String s2 [match] | | Patterns.cs:30:13:30:27 | After case ...: [no-match] | Patterns.cs:30:18:30:26 | After String s2 [no-match] | | Patterns.cs:30:13:30:27 | case ...: | Patterns.cs:27:13:27:24 | After case ...: [no-match] | -| Patterns.cs:30:18:30:26 | String s2 | Patterns.cs:30:13:30:27 | case ...: | +| Patterns.cs:30:18:30:26 | Before String s2 | Patterns.cs:30:13:30:27 | case ...: | +| Patterns.cs:30:18:30:26 | String s2 | Patterns.cs:30:25:30:26 | access to local variable s2 | +| Patterns.cs:30:25:30:26 | access to local variable s2 | Patterns.cs:30:18:30:26 | Before String s2 | | Patterns.cs:31:17:31:49 | After call to method WriteLine | Patterns.cs:31:17:31:49 | call to method WriteLine | | Patterns.cs:31:17:31:49 | Before call to method WriteLine | Patterns.cs:31:17:31:50 | ...; | | Patterns.cs:31:17:31:49 | call to method WriteLine | Patterns.cs:31:35:31:48 | After $"..." | @@ -13062,7 +13110,9 @@ postDominance | Patterns.cs:33:13:33:24 | After case ...: [match] | Patterns.cs:33:18:33:23 | After Object v2 [match] | | Patterns.cs:33:13:33:24 | After case ...: [no-match] | Patterns.cs:33:18:33:23 | After Object v2 [no-match] | | Patterns.cs:33:13:33:24 | case ...: | Patterns.cs:30:13:30:27 | After case ...: [no-match] | -| Patterns.cs:33:18:33:23 | Object v2 | Patterns.cs:33:13:33:24 | case ...: | +| Patterns.cs:33:18:33:23 | Before Object v2 | Patterns.cs:33:13:33:24 | case ...: | +| Patterns.cs:33:18:33:23 | Object v2 | Patterns.cs:33:22:33:23 | access to local variable v2 | +| Patterns.cs:33:22:33:23 | access to local variable v2 | Patterns.cs:33:18:33:23 | Before Object v2 | | Patterns.cs:34:17:34:22 | Before break; | Patterns.cs:33:13:33:24 | After case ...: [match] | | Patterns.cs:34:17:34:22 | break; | Patterns.cs:34:17:34:22 | Before break; | | Patterns.cs:35:13:35:20 | After default: [match] | Patterns.cs:35:13:35:20 | default: | @@ -13127,15 +13177,18 @@ postDominance | Patterns.cs:54:14:54:37 | After not ... | Patterns.cs:54:14:54:37 | not ... | | Patterns.cs:54:14:54:37 | Before not ... | Patterns.cs:54:9:54:37 | [MatchTrue] ... is ... | | Patterns.cs:54:14:54:37 | not ... | Patterns.cs:54:18:54:37 | After { ... } | -| Patterns.cs:54:18:54:25 | access to type Patterns | Patterns.cs:54:18:54:37 | Patterns u | +| Patterns.cs:54:18:54:25 | access to type Patterns | Patterns.cs:54:18:54:37 | After Patterns u | +| Patterns.cs:54:18:54:37 | After Patterns u | Patterns.cs:54:18:54:37 | Patterns u | | Patterns.cs:54:18:54:37 | After { ... } | Patterns.cs:54:18:54:37 | { ... } | +| Patterns.cs:54:18:54:37 | Before Patterns u | Patterns.cs:54:18:54:37 | Before { ... } | | Patterns.cs:54:18:54:37 | Before { ... } | Patterns.cs:54:14:54:37 | Before not ... | -| Patterns.cs:54:18:54:37 | Patterns u | Patterns.cs:54:18:54:37 | Before { ... } | +| Patterns.cs:54:18:54:37 | Patterns u | Patterns.cs:54:37:54:37 | access to local variable u | | Patterns.cs:54:18:54:37 | { ... } | Patterns.cs:54:27:54:35 | After { ... } | | Patterns.cs:54:27:54:35 | After { ... } | Patterns.cs:54:27:54:35 | { ... } | | Patterns.cs:54:27:54:35 | Before { ... } | Patterns.cs:54:18:54:25 | access to type Patterns | | Patterns.cs:54:27:54:35 | { ... } | Patterns.cs:54:33:54:33 | 1 | | Patterns.cs:54:33:54:33 | 1 | Patterns.cs:54:27:54:35 | Before { ... } | +| Patterns.cs:54:37:54:37 | access to local variable u | Patterns.cs:54:18:54:37 | Before Patterns u | | Patterns.cs:56:26:56:27 | Exit | Patterns.cs:56:26:56:27 | Normal Exit | | Patterns.cs:56:26:56:27 | Normal Exit | Patterns.cs:58:9:62:10 | return ...; | | Patterns.cs:56:33:56:33 | i | Patterns.cs:56:26:56:27 | Entry | @@ -13567,7 +13620,9 @@ postDominance | Switch.cs:20:13:20:23 | After case ...: [match] | Switch.cs:20:18:20:22 | After Int32 i [match] | | Switch.cs:20:13:20:23 | After case ...: [no-match] | Switch.cs:20:18:20:22 | After Int32 i [no-match] | | Switch.cs:20:13:20:23 | case ...: | Switch.cs:18:13:18:22 | After case ...: [no-match] | -| Switch.cs:20:18:20:22 | Int32 i | Switch.cs:20:13:20:23 | case ...: | +| Switch.cs:20:18:20:22 | Before Int32 i | Switch.cs:20:13:20:23 | case ...: | +| Switch.cs:20:18:20:22 | Int32 i | Switch.cs:20:22:20:22 | access to local variable i | +| Switch.cs:20:22:20:22 | access to local variable i | Switch.cs:20:18:20:22 | Before Int32 i | | Switch.cs:21:17:22:27 | After if (...) ... | Switch.cs:21:21:21:29 | After ... == ... [false] | | Switch.cs:21:17:22:27 | if (...) ... | Switch.cs:20:13:20:23 | After case ...: [match] | | Switch.cs:21:21:21:21 | access to parameter o | Switch.cs:21:21:21:29 | Before ... == ... | @@ -13583,7 +13638,9 @@ postDominance | Switch.cs:24:13:24:56 | After case ...: [match] | Switch.cs:24:18:24:25 | After String s [match] | | Switch.cs:24:13:24:56 | After case ...: [no-match] | Switch.cs:24:18:24:25 | After String s [no-match] | | Switch.cs:24:13:24:56 | case ...: | Switch.cs:20:13:20:23 | After case ...: [no-match] | -| Switch.cs:24:18:24:25 | String s | Switch.cs:24:13:24:56 | case ...: | +| Switch.cs:24:18:24:25 | Before String s | Switch.cs:24:13:24:56 | case ...: | +| Switch.cs:24:18:24:25 | String s | Switch.cs:24:25:24:25 | access to local variable s | +| Switch.cs:24:25:24:25 | access to local variable s | Switch.cs:24:18:24:25 | Before String s | | Switch.cs:24:32:24:32 | access to local variable s | Switch.cs:24:32:24:39 | Before access to property Length | | Switch.cs:24:32:24:39 | After access to property Length | Switch.cs:24:32:24:39 | access to property Length | | Switch.cs:24:32:24:39 | Before access to property Length | Switch.cs:24:32:24:43 | Before ... > ... | @@ -13612,7 +13669,9 @@ postDominance | Switch.cs:27:13:27:39 | case ...: | Switch.cs:24:13:24:56 | After case ...: [no-match] | | Switch.cs:27:13:27:39 | case ...: | Switch.cs:24:32:24:55 | After ... && ... [false] | | Switch.cs:27:18:27:25 | After Double d [no-match] | Switch.cs:27:18:27:25 | Double d | -| Switch.cs:27:18:27:25 | Double d | Switch.cs:27:13:27:39 | case ...: | +| Switch.cs:27:18:27:25 | Before Double d | Switch.cs:27:13:27:39 | case ...: | +| Switch.cs:27:18:27:25 | Double d | Switch.cs:27:25:27:25 | access to local variable d | +| Switch.cs:27:25:27:25 | access to local variable d | Switch.cs:27:18:27:25 | Before Double d | | Switch.cs:27:32:27:38 | Before call to method Throw | Switch.cs:27:13:27:39 | After case ...: [match] | | Switch.cs:27:32:27:38 | call to method Throw | Switch.cs:27:32:27:38 | Before call to method Throw | | Switch.cs:28:13:28:17 | Label: | Switch.cs:31:17:31:27 | goto ...; | @@ -13855,10 +13914,12 @@ postDominance | 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:29 | Before Boolean b | Switch.cs:125:24:125:34 | ... => ... | +| Switch.cs:125:24:125:29 | Boolean b | Switch.cs:125:29:125:29 | access to local variable b | | 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] | | Switch.cs:125:24:125:34 | After ... => ... [no-match] | Switch.cs:125:24:125:29 | After Boolean b [no-match] | +| Switch.cs:125:29:125:29 | access to local variable b | Switch.cs:125:24:125:29 | Before Boolean b | | Switch.cs:125:34:125:34 | access to local variable b | Switch.cs:125:24:125:34 | After ... => ... [match] | | Switch.cs:125:37:125:37 | After _ [match] | Switch.cs:125:37:125:37 | _ | | Switch.cs:125:37:125:37 | _ | Switch.cs:125:37:125:46 | ... => ... | @@ -13884,10 +13945,12 @@ postDominance | 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:35 | Before String s | Switch.cs:131:28:131:40 | ... => ... | +| Switch.cs:131:28:131:35 | String s | Switch.cs:131:35:131:35 | access to local variable s | | 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] | | Switch.cs:131:28:131:40 | After ... => ... [no-match] | Switch.cs:131:28:131:35 | After String s [no-match] | +| Switch.cs:131:35:131:35 | access to local variable s | Switch.cs:131:28:131:35 | Before String s | | Switch.cs:131:40:131:40 | access to local variable s | Switch.cs:131:28:131:40 | After ... => ... [match] | | Switch.cs:131:43:131:43 | After _ [match] | Switch.cs:131:43:131:43 | _ | | Switch.cs:131:43:131:43 | _ | Switch.cs:131:43:131:51 | ... => ... | @@ -14099,9 +14162,12 @@ postDominance | TypeAccesses.cs:7:9:7:25 | if (...) ... | TypeAccesses.cs:6:9:6:24 | After ...; | | TypeAccesses.cs:7:13:7:13 | access to parameter o | TypeAccesses.cs:7:13:7:22 | Before ... is ... | | TypeAccesses.cs:7:13:7:22 | ... is ... | TypeAccesses.cs:7:13:7:13 | access to parameter o | -| TypeAccesses.cs:7:13:7:22 | After ... is ... [true] | TypeAccesses.cs:7:18:7:22 | Int32 j | +| TypeAccesses.cs:7:13:7:22 | After ... is ... [true] | TypeAccesses.cs:7:18:7:22 | After Int32 j | | TypeAccesses.cs:7:13:7:22 | Before ... is ... | TypeAccesses.cs:7:9:7:25 | if (...) ... | -| TypeAccesses.cs:7:18:7:22 | Int32 j | TypeAccesses.cs:7:13:7:22 | [MatchTrue] ... is ... | +| TypeAccesses.cs:7:18:7:22 | After Int32 j | TypeAccesses.cs:7:18:7:22 | Int32 j | +| TypeAccesses.cs:7:18:7:22 | Before Int32 j | TypeAccesses.cs:7:13:7:22 | [MatchTrue] ... is ... | +| TypeAccesses.cs:7:18:7:22 | Int32 j | TypeAccesses.cs:7:22:7:22 | access to local variable j | +| TypeAccesses.cs:7:22:7:22 | access to local variable j | TypeAccesses.cs:7:18:7:22 | Before Int32 j | | TypeAccesses.cs:7:25:7:25 | ; | TypeAccesses.cs:7:13:7:22 | After ... is ... [true] | | TypeAccesses.cs:8:9:8:28 | ... ...; | TypeAccesses.cs:7:9:7:25 | After if (...) ... | | TypeAccesses.cs:8:9:8:28 | After ... ...; | TypeAccesses.cs:8:13:8:27 | After Type t = ... | diff --git a/csharp/ql/test/library-tests/controlflow/graph/EnclosingCallable.expected b/csharp/ql/test/library-tests/controlflow/graph/EnclosingCallable.expected index ad6503ab19ed..925b5272c610 100644 --- a/csharp/ql/test/library-tests/controlflow/graph/EnclosingCallable.expected +++ b/csharp/ql/test/library-tests/controlflow/graph/EnclosingCallable.expected @@ -5569,7 +5569,10 @@ nodeEnclosing | Patterns.cs:8:13:8:23 | After ... is ... [true] | Patterns.cs:5:10:5:11 | M1 | | Patterns.cs:8:13:8:23 | Before ... is ... | Patterns.cs:5:10:5:11 | M1 | | Patterns.cs:8:13:8:23 | [MatchTrue] ... is ... | Patterns.cs:5:10:5:11 | M1 | +| Patterns.cs:8:18:8:23 | After Int32 i1 | Patterns.cs:5:10:5:11 | M1 | +| Patterns.cs:8:18:8:23 | Before Int32 i1 | Patterns.cs:5:10:5:11 | M1 | | Patterns.cs:8:18:8:23 | Int32 i1 | Patterns.cs:5:10:5:11 | M1 | +| Patterns.cs:8:22:8:23 | access to local variable i1 | Patterns.cs:5:10:5:11 | M1 | | Patterns.cs:9:9:11:9 | After {...} | Patterns.cs:5:10:5:11 | M1 | | Patterns.cs:9:9:11:9 | {...} | Patterns.cs:5:10:5:11 | M1 | | Patterns.cs:10:13:10:42 | After call to method WriteLine | Patterns.cs:5:10:5:11 | M1 | @@ -5593,7 +5596,10 @@ nodeEnclosing | Patterns.cs:12:18:12:31 | After ... is ... [true] | Patterns.cs:5:10:5:11 | M1 | | Patterns.cs:12:18:12:31 | Before ... is ... | Patterns.cs:5:10:5:11 | M1 | | Patterns.cs:12:18:12:31 | [MatchTrue] ... is ... | Patterns.cs:5:10:5:11 | M1 | +| Patterns.cs:12:23:12:31 | After String s1 | Patterns.cs:5:10:5:11 | M1 | +| Patterns.cs:12:23:12:31 | Before String s1 | Patterns.cs:5:10:5:11 | M1 | | Patterns.cs:12:23:12:31 | String s1 | Patterns.cs:5:10:5:11 | M1 | +| Patterns.cs:12:30:12:31 | access to local variable s1 | Patterns.cs:5:10:5:11 | M1 | | Patterns.cs:13:9:15:9 | After {...} | Patterns.cs:5:10:5:11 | M1 | | Patterns.cs:13:9:15:9 | {...} | Patterns.cs:5:10:5:11 | M1 | | Patterns.cs:14:13:14:45 | After call to method WriteLine | Patterns.cs:5:10:5:11 | M1 | @@ -5617,7 +5623,10 @@ nodeEnclosing | Patterns.cs:16:18:16:28 | After ... is ... [true] | Patterns.cs:5:10:5:11 | M1 | | Patterns.cs:16:18:16:28 | Before ... is ... | Patterns.cs:5:10:5:11 | M1 | | Patterns.cs:16:18:16:28 | [MatchTrue] ... is ... | Patterns.cs:5:10:5:11 | M1 | +| Patterns.cs:16:23:16:28 | After Object v1 | Patterns.cs:5:10:5:11 | M1 | +| Patterns.cs:16:23:16:28 | Before Object v1 | Patterns.cs:5:10:5:11 | M1 | | Patterns.cs:16:23:16:28 | Object v1 | Patterns.cs:5:10:5:11 | M1 | +| Patterns.cs:16:27:16:28 | access to local variable v1 | Patterns.cs:5:10:5:11 | M1 | | Patterns.cs:17:9:18:9 | {...} | Patterns.cs:5:10:5:11 | M1 | | Patterns.cs:20:9:38:9 | After switch (...) {...} | Patterns.cs:5:10:5:11 | M1 | | Patterns.cs:20:9:38:9 | switch (...) {...} | Patterns.cs:5:10:5:11 | M1 | @@ -5635,7 +5644,9 @@ nodeEnclosing | Patterns.cs:24:13:24:36 | case ...: | Patterns.cs:5:10:5:11 | M1 | | Patterns.cs:24:18:24:23 | After Int32 i2 [match] | Patterns.cs:5:10:5:11 | M1 | | Patterns.cs:24:18:24:23 | After Int32 i2 [no-match] | Patterns.cs:5:10:5:11 | M1 | +| Patterns.cs:24:18:24:23 | Before Int32 i2 | Patterns.cs:5:10:5:11 | M1 | | Patterns.cs:24:18:24:23 | Int32 i2 | Patterns.cs:5:10:5:11 | M1 | +| Patterns.cs:24:22:24:23 | access to local variable i2 | Patterns.cs:5:10:5:11 | M1 | | Patterns.cs:24:30:24:31 | access to local variable i2 | Patterns.cs:5:10:5:11 | M1 | | Patterns.cs:24:30:24:35 | ... > ... | Patterns.cs:5:10:5:11 | M1 | | Patterns.cs:24:30:24:35 | After ... > ... [false] | Patterns.cs:5:10:5:11 | M1 | @@ -5662,7 +5673,9 @@ nodeEnclosing | Patterns.cs:27:13:27:24 | case ...: | Patterns.cs:5:10:5:11 | M1 | | Patterns.cs:27:18:27:23 | After Int32 i3 [match] | Patterns.cs:5:10:5:11 | M1 | | Patterns.cs:27:18:27:23 | After Int32 i3 [no-match] | Patterns.cs:5:10:5:11 | M1 | +| Patterns.cs:27:18:27:23 | Before Int32 i3 | Patterns.cs:5:10:5:11 | M1 | | Patterns.cs:27:18:27:23 | Int32 i3 | Patterns.cs:5:10:5:11 | M1 | +| Patterns.cs:27:22:27:23 | access to local variable i3 | Patterns.cs:5:10:5:11 | M1 | | Patterns.cs:28:17:28:46 | After call to method WriteLine | Patterns.cs:5:10:5:11 | M1 | | Patterns.cs:28:17:28:46 | Before call to method WriteLine | Patterns.cs:5:10:5:11 | M1 | | Patterns.cs:28:17:28:46 | call to method WriteLine | Patterns.cs:5:10:5:11 | M1 | @@ -5683,7 +5696,9 @@ nodeEnclosing | Patterns.cs:30:13:30:27 | case ...: | Patterns.cs:5:10:5:11 | M1 | | Patterns.cs:30:18:30:26 | After String s2 [match] | Patterns.cs:5:10:5:11 | M1 | | Patterns.cs:30:18:30:26 | After String s2 [no-match] | Patterns.cs:5:10:5:11 | M1 | +| Patterns.cs:30:18:30:26 | Before String s2 | Patterns.cs:5:10:5:11 | M1 | | Patterns.cs:30:18:30:26 | String s2 | Patterns.cs:5:10:5:11 | M1 | +| Patterns.cs:30:25:30:26 | access to local variable s2 | Patterns.cs:5:10:5:11 | M1 | | Patterns.cs:31:17:31:49 | After call to method WriteLine | Patterns.cs:5:10:5:11 | M1 | | Patterns.cs:31:17:31:49 | Before call to method WriteLine | Patterns.cs:5:10:5:11 | M1 | | Patterns.cs:31:17:31:49 | call to method WriteLine | Patterns.cs:5:10:5:11 | M1 | @@ -5704,7 +5719,9 @@ nodeEnclosing | Patterns.cs:33:13:33:24 | case ...: | Patterns.cs:5:10:5:11 | M1 | | Patterns.cs:33:18:33:23 | After Object v2 [match] | Patterns.cs:5:10:5:11 | M1 | | Patterns.cs:33:18:33:23 | After Object v2 [no-match] | Patterns.cs:5:10:5:11 | M1 | +| Patterns.cs:33:18:33:23 | Before Object v2 | Patterns.cs:5:10:5:11 | M1 | | Patterns.cs:33:18:33:23 | Object v2 | Patterns.cs:5:10:5:11 | M1 | +| Patterns.cs:33:22:33:23 | access to local variable v2 | Patterns.cs:5:10:5:11 | M1 | | Patterns.cs:34:17:34:22 | Before break; | Patterns.cs:5:10:5:11 | M1 | | Patterns.cs:34:17:34:22 | break; | Patterns.cs:5:10:5:11 | M1 | | Patterns.cs:35:13:35:20 | After default: [match] | Patterns.cs:5:10:5:11 | M1 | @@ -5774,7 +5791,9 @@ nodeEnclosing | Patterns.cs:54:14:54:37 | Before not ... | Patterns.cs:53:24:53:25 | M4 | | Patterns.cs:54:14:54:37 | not ... | Patterns.cs:53:24:53:25 | M4 | | Patterns.cs:54:18:54:25 | access to type Patterns | Patterns.cs:53:24:53:25 | M4 | +| Patterns.cs:54:18:54:37 | After Patterns u | Patterns.cs:53:24:53:25 | M4 | | Patterns.cs:54:18:54:37 | After { ... } | Patterns.cs:53:24:53:25 | M4 | +| Patterns.cs:54:18:54:37 | Before Patterns u | Patterns.cs:53:24:53:25 | M4 | | Patterns.cs:54:18:54:37 | Before { ... } | Patterns.cs:53:24:53:25 | M4 | | Patterns.cs:54:18:54:37 | Patterns u | Patterns.cs:53:24:53:25 | M4 | | Patterns.cs:54:18:54:37 | { ... } | Patterns.cs:53:24:53:25 | M4 | @@ -5782,6 +5801,7 @@ nodeEnclosing | Patterns.cs:54:27:54:35 | Before { ... } | Patterns.cs:53:24:53:25 | M4 | | Patterns.cs:54:27:54:35 | { ... } | Patterns.cs:53:24:53:25 | M4 | | Patterns.cs:54:33:54:33 | 1 | Patterns.cs:53:24:53:25 | M4 | +| Patterns.cs:54:37:54:37 | access to local variable u | Patterns.cs:53:24:53:25 | M4 | | Patterns.cs:56:26:56:27 | Entry | Patterns.cs:56:26:56:27 | M5 | | Patterns.cs:56:26:56:27 | Exit | Patterns.cs:56:26:56:27 | M5 | | Patterns.cs:56:26:56:27 | Normal Exit | Patterns.cs:56:26:56:27 | M5 | @@ -6249,7 +6269,9 @@ nodeEnclosing | Switch.cs:20:13:20:23 | case ...: | Switch.cs:10:10:10:11 | M2 | | Switch.cs:20:18:20:22 | After Int32 i [match] | Switch.cs:10:10:10:11 | M2 | | Switch.cs:20:18:20:22 | After Int32 i [no-match] | Switch.cs:10:10:10:11 | M2 | +| Switch.cs:20:18:20:22 | Before Int32 i | Switch.cs:10:10:10:11 | M2 | | Switch.cs:20:18:20:22 | Int32 i | Switch.cs:10:10:10:11 | M2 | +| Switch.cs:20:22:20:22 | access to local variable i | Switch.cs:10:10:10:11 | M2 | | Switch.cs:21:17:22:27 | After if (...) ... | Switch.cs:10:10:10:11 | M2 | | Switch.cs:21:17:22:27 | if (...) ... | Switch.cs:10:10:10:11 | M2 | | Switch.cs:21:21:21:21 | access to parameter o | Switch.cs:10:10:10:11 | M2 | @@ -6268,7 +6290,9 @@ nodeEnclosing | Switch.cs:24:13:24:56 | case ...: | Switch.cs:10:10:10:11 | M2 | | Switch.cs:24:18:24:25 | After String s [match] | Switch.cs:10:10:10:11 | M2 | | Switch.cs:24:18:24:25 | After String s [no-match] | Switch.cs:10:10:10:11 | M2 | +| Switch.cs:24:18:24:25 | Before String s | Switch.cs:10:10:10:11 | M2 | | Switch.cs:24:18:24:25 | String s | Switch.cs:10:10:10:11 | M2 | +| Switch.cs:24:25:24:25 | access to local variable s | Switch.cs:10:10:10:11 | M2 | | Switch.cs:24:32:24:32 | access to local variable s | Switch.cs:10:10:10:11 | M2 | | Switch.cs:24:32:24:39 | After access to property Length | Switch.cs:10:10:10:11 | M2 | | Switch.cs:24:32:24:39 | Before access to property Length | Switch.cs:10:10:10:11 | M2 | @@ -6300,7 +6324,9 @@ nodeEnclosing | Switch.cs:27:13:27:39 | case ...: | Switch.cs:10:10:10:11 | M2 | | Switch.cs:27:18:27:25 | After Double d [match] | Switch.cs:10:10:10:11 | M2 | | Switch.cs:27:18:27:25 | After Double d [no-match] | Switch.cs:10:10:10:11 | M2 | +| Switch.cs:27:18:27:25 | Before Double d | Switch.cs:10:10:10:11 | M2 | | Switch.cs:27:18:27:25 | Double d | Switch.cs:10:10:10:11 | M2 | +| Switch.cs:27:25:27:25 | access to local variable d | Switch.cs:10:10:10:11 | M2 | | Switch.cs:27:32:27:38 | Before call to method Throw | Switch.cs:10:10:10:11 | M2 | | Switch.cs:27:32:27:38 | call to method Throw | Switch.cs:10:10:10:11 | M2 | | Switch.cs:28:13:28:17 | Label: | Switch.cs:10:10:10:11 | M2 | @@ -6570,10 +6596,12 @@ nodeEnclosing | 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:24:125:29 | Before Boolean b | Switch.cs:123:10:123:12 | M11 | | Switch.cs:125:24:125:29 | Boolean b | Switch.cs:123:10:123:12 | M11 | | 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:29:125:29 | access to local variable b | 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 | @@ -6601,10 +6629,12 @@ nodeEnclosing | 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:28:131:35 | Before String s | Switch.cs:129:12:129:14 | M12 | | Switch.cs:131:28:131:35 | String s | Switch.cs:129:12:129:14 | M12 | | 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:35:131:35 | access to local variable s | 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 | @@ -6839,7 +6869,10 @@ nodeEnclosing | TypeAccesses.cs:7:13:7:22 | After ... is ... [true] | TypeAccesses.cs:3:10:3:10 | M | | TypeAccesses.cs:7:13:7:22 | Before ... is ... | TypeAccesses.cs:3:10:3:10 | M | | TypeAccesses.cs:7:13:7:22 | [MatchTrue] ... is ... | TypeAccesses.cs:3:10:3:10 | M | +| TypeAccesses.cs:7:18:7:22 | After Int32 j | TypeAccesses.cs:3:10:3:10 | M | +| TypeAccesses.cs:7:18:7:22 | Before Int32 j | TypeAccesses.cs:3:10:3:10 | M | | TypeAccesses.cs:7:18:7:22 | Int32 j | TypeAccesses.cs:3:10:3:10 | M | +| TypeAccesses.cs:7:22:7:22 | access to local variable j | TypeAccesses.cs:3:10:3:10 | M | | TypeAccesses.cs:7:25:7:25 | ; | TypeAccesses.cs:3:10:3:10 | M | | TypeAccesses.cs:8:9:8:28 | ... ...; | TypeAccesses.cs:3:10:3:10 | M | | TypeAccesses.cs:8:9:8:28 | After ... ...; | TypeAccesses.cs:3:10:3:10 | M | diff --git a/csharp/ql/test/library-tests/controlflow/graph/EntryElement.expected b/csharp/ql/test/library-tests/controlflow/graph/EntryElement.expected index 24bd5a4c74e2..01f6125c14a5 100644 --- a/csharp/ql/test/library-tests/controlflow/graph/EntryElement.expected +++ b/csharp/ql/test/library-tests/controlflow/graph/EntryElement.expected @@ -2541,7 +2541,8 @@ | Patterns.cs:8:9:18:9 | if (...) ... | Patterns.cs:8:9:18:9 | if (...) ... | | Patterns.cs:8:13:8:13 | access to local variable o | Patterns.cs:8:13:8:13 | access to local variable o | | Patterns.cs:8:13:8:23 | ... is ... | Patterns.cs:8:13:8:13 | access to local variable o | -| Patterns.cs:8:18:8:23 | Int32 i1 | Patterns.cs:8:18:8:23 | Int32 i1 | +| Patterns.cs:8:18:8:23 | Int32 i1 | Patterns.cs:8:22:8:23 | access to local variable i1 | +| Patterns.cs:8:22:8:23 | access to local variable i1 | Patterns.cs:8:22:8:23 | access to local variable i1 | | Patterns.cs:9:9:11:9 | {...} | Patterns.cs:9:9:11:9 | {...} | | Patterns.cs:10:13:10:42 | call to method WriteLine | Patterns.cs:10:33:10:36 | "int " | | Patterns.cs:10:13:10:43 | ...; | Patterns.cs:10:13:10:43 | ...; | @@ -2552,7 +2553,8 @@ | Patterns.cs:12:14:18:9 | if (...) ... | Patterns.cs:12:14:18:9 | if (...) ... | | Patterns.cs:12:18:12:18 | access to local variable o | Patterns.cs:12:18:12:18 | access to local variable o | | Patterns.cs:12:18:12:31 | ... is ... | Patterns.cs:12:18:12:18 | access to local variable o | -| Patterns.cs:12:23:12:31 | String s1 | Patterns.cs:12:23:12:31 | String s1 | +| Patterns.cs:12:23:12:31 | String s1 | Patterns.cs:12:30:12:31 | access to local variable s1 | +| Patterns.cs:12:30:12:31 | access to local variable s1 | Patterns.cs:12:30:12:31 | access to local variable s1 | | Patterns.cs:13:9:15:9 | {...} | Patterns.cs:13:9:15:9 | {...} | | Patterns.cs:14:13:14:45 | call to method WriteLine | Patterns.cs:14:33:14:39 | "string " | | Patterns.cs:14:13:14:46 | ...; | Patterns.cs:14:13:14:46 | ...; | @@ -2563,7 +2565,8 @@ | Patterns.cs:16:14:18:9 | if (...) ... | Patterns.cs:16:14:18:9 | if (...) ... | | Patterns.cs:16:18:16:18 | access to local variable o | Patterns.cs:16:18:16:18 | access to local variable o | | Patterns.cs:16:18:16:28 | ... is ... | Patterns.cs:16:18:16:18 | access to local variable o | -| Patterns.cs:16:23:16:28 | Object v1 | Patterns.cs:16:23:16:28 | Object v1 | +| Patterns.cs:16:23:16:28 | Object v1 | Patterns.cs:16:27:16:28 | access to local variable v1 | +| Patterns.cs:16:27:16:28 | access to local variable v1 | Patterns.cs:16:27:16:28 | access to local variable v1 | | Patterns.cs:17:9:18:9 | {...} | Patterns.cs:17:9:18:9 | {...} | | Patterns.cs:20:9:38:9 | switch (...) {...} | Patterns.cs:20:9:38:9 | switch (...) {...} | | Patterns.cs:20:17:20:17 | access to local variable o | Patterns.cs:20:17:20:17 | access to local variable o | @@ -2571,7 +2574,8 @@ | Patterns.cs:22:18:22:22 | "xyz" | Patterns.cs:22:18:22:22 | "xyz" | | Patterns.cs:23:17:23:22 | break; | Patterns.cs:23:17:23:22 | break; | | Patterns.cs:24:13:24:36 | case ...: | Patterns.cs:24:13:24:36 | case ...: | -| Patterns.cs:24:18:24:23 | Int32 i2 | Patterns.cs:24:18:24:23 | Int32 i2 | +| Patterns.cs:24:18:24:23 | Int32 i2 | Patterns.cs:24:22:24:23 | access to local variable i2 | +| Patterns.cs:24:22:24:23 | access to local variable i2 | Patterns.cs:24:22:24:23 | access to local variable i2 | | Patterns.cs:24:30:24:31 | access to local variable i2 | Patterns.cs:24:30:24:31 | access to local variable i2 | | Patterns.cs:24:30:24:35 | ... > ... | Patterns.cs:24:30:24:31 | access to local variable i2 | | Patterns.cs:24:35:24:35 | 0 | Patterns.cs:24:35:24:35 | 0 | @@ -2583,7 +2587,8 @@ | Patterns.cs:25:47:25:48 | access to local variable i2 | Patterns.cs:25:47:25:48 | access to local variable i2 | | Patterns.cs:26:17:26:22 | break; | Patterns.cs:26:17:26:22 | break; | | Patterns.cs:27:13:27:24 | case ...: | Patterns.cs:27:13:27:24 | case ...: | -| Patterns.cs:27:18:27:23 | Int32 i3 | Patterns.cs:27:18:27:23 | Int32 i3 | +| Patterns.cs:27:18:27:23 | Int32 i3 | Patterns.cs:27:22:27:23 | access to local variable i3 | +| Patterns.cs:27:22:27:23 | access to local variable i3 | Patterns.cs:27:22:27:23 | access to local variable i3 | | Patterns.cs:28:17:28:46 | call to method WriteLine | Patterns.cs:28:37:28:40 | "int " | | Patterns.cs:28:17:28:47 | ...; | Patterns.cs:28:17:28:47 | ...; | | Patterns.cs:28:35:28:45 | $"..." | Patterns.cs:28:37:28:40 | "int " | @@ -2592,7 +2597,8 @@ | Patterns.cs:28:42:28:43 | access to local variable i3 | Patterns.cs:28:42:28:43 | access to local variable i3 | | Patterns.cs:29:17:29:22 | break; | Patterns.cs:29:17:29:22 | break; | | Patterns.cs:30:13:30:27 | case ...: | Patterns.cs:30:13:30:27 | case ...: | -| Patterns.cs:30:18:30:26 | String s2 | Patterns.cs:30:18:30:26 | String s2 | +| Patterns.cs:30:18:30:26 | String s2 | Patterns.cs:30:25:30:26 | access to local variable s2 | +| Patterns.cs:30:25:30:26 | access to local variable s2 | Patterns.cs:30:25:30:26 | access to local variable s2 | | Patterns.cs:31:17:31:49 | call to method WriteLine | Patterns.cs:31:37:31:43 | "string " | | Patterns.cs:31:17:31:50 | ...; | Patterns.cs:31:17:31:50 | ...; | | Patterns.cs:31:35:31:48 | $"..." | Patterns.cs:31:37:31:43 | "string " | @@ -2601,7 +2607,8 @@ | Patterns.cs:31:45:31:46 | access to local variable s2 | Patterns.cs:31:45:31:46 | access to local variable s2 | | Patterns.cs:32:17:32:22 | break; | Patterns.cs:32:17:32:22 | break; | | Patterns.cs:33:13:33:24 | case ...: | Patterns.cs:33:13:33:24 | case ...: | -| Patterns.cs:33:18:33:23 | Object v2 | Patterns.cs:33:18:33:23 | Object v2 | +| Patterns.cs:33:18:33:23 | Object v2 | Patterns.cs:33:22:33:23 | access to local variable v2 | +| Patterns.cs:33:22:33:23 | access to local variable v2 | Patterns.cs:33:22:33:23 | access to local variable v2 | | Patterns.cs:34:17:34:22 | break; | Patterns.cs:34:17:34:22 | break; | | Patterns.cs:35:13:35:20 | default: | Patterns.cs:35:13:35:20 | default: | | Patterns.cs:36:17:36:51 | call to method WriteLine | Patterns.cs:36:35:36:50 | "Something else" | @@ -2630,12 +2637,13 @@ | Patterns.cs:53:34:53:34 | c | Patterns.cs:53:34:53:34 | c | | Patterns.cs:54:9:54:9 | access to parameter c | Patterns.cs:54:9:54:9 | access to parameter c | | Patterns.cs:54:9:54:37 | ... is ... | Patterns.cs:54:9:54:9 | access to parameter c | -| Patterns.cs:54:14:54:37 | not ... | Patterns.cs:54:18:54:37 | Patterns u | +| Patterns.cs:54:14:54:37 | not ... | Patterns.cs:54:37:54:37 | access to local variable u | | Patterns.cs:54:18:54:25 | access to type Patterns | Patterns.cs:54:18:54:25 | access to type Patterns | -| Patterns.cs:54:18:54:37 | Patterns u | Patterns.cs:54:18:54:37 | Patterns u | -| Patterns.cs:54:18:54:37 | { ... } | Patterns.cs:54:18:54:37 | Patterns u | +| Patterns.cs:54:18:54:37 | Patterns u | Patterns.cs:54:37:54:37 | access to local variable u | +| Patterns.cs:54:18:54:37 | { ... } | Patterns.cs:54:37:54:37 | access to local variable u | | Patterns.cs:54:27:54:35 | { ... } | Patterns.cs:54:33:54:33 | 1 | | Patterns.cs:54:33:54:33 | 1 | Patterns.cs:54:33:54:33 | 1 | +| Patterns.cs:54:37:54:37 | access to local variable u | Patterns.cs:54:37:54:37 | access to local variable u | | Patterns.cs:56:33:56:33 | i | Patterns.cs:56:33:56:33 | i | | Patterns.cs:57:5:63:5 | {...} | Patterns.cs:57:5:63:5 | {...} | | Patterns.cs:58:9:62:10 | return ...; | Patterns.cs:58:16:62:9 | ... switch { ... } | @@ -2841,7 +2849,8 @@ | Switch.cs:18:18:18:21 | null | Switch.cs:18:18:18:21 | null | | Switch.cs:19:17:19:29 | goto default; | Switch.cs:19:17:19:29 | goto default; | | Switch.cs:20:13:20:23 | case ...: | Switch.cs:20:13:20:23 | case ...: | -| Switch.cs:20:18:20:22 | Int32 i | Switch.cs:20:18:20:22 | Int32 i | +| Switch.cs:20:18:20:22 | Int32 i | Switch.cs:20:22:20:22 | access to local variable i | +| Switch.cs:20:22:20:22 | access to local variable i | Switch.cs:20:22:20:22 | access to local variable i | | Switch.cs:21:17:22:27 | if (...) ... | Switch.cs:21:17:22:27 | if (...) ... | | Switch.cs:21:21:21:21 | access to parameter o | Switch.cs:21:21:21:21 | access to parameter o | | Switch.cs:21:21:21:29 | ... == ... | Switch.cs:21:21:21:21 | access to parameter o | @@ -2850,7 +2859,8 @@ | Switch.cs:23:17:23:28 | goto case ...; | Switch.cs:23:27:23:27 | 0 | | Switch.cs:23:27:23:27 | 0 | Switch.cs:23:27:23:27 | 0 | | Switch.cs:24:13:24:56 | case ...: | Switch.cs:24:13:24:56 | case ...: | -| Switch.cs:24:18:24:25 | String s | Switch.cs:24:18:24:25 | String s | +| Switch.cs:24:18:24:25 | String s | Switch.cs:24:25:24:25 | access to local variable s | +| Switch.cs:24:25:24:25 | access to local variable s | Switch.cs:24:25:24:25 | access to local variable s | | Switch.cs:24:32:24:32 | access to local variable s | Switch.cs:24:32:24:32 | access to local variable s | | Switch.cs:24:32:24:39 | access to property Length | Switch.cs:24:32:24:32 | access to local variable s | | Switch.cs:24:32:24:43 | ... > ... | Switch.cs:24:32:24:32 | access to local variable s | @@ -2864,7 +2874,8 @@ | Switch.cs:25:35:25:35 | access to local variable s | Switch.cs:25:35:25:35 | access to local variable s | | Switch.cs:26:17:26:23 | return ...; | Switch.cs:26:17:26:23 | return ...; | | Switch.cs:27:13:27:39 | case ...: | Switch.cs:27:13:27:39 | case ...: | -| Switch.cs:27:18:27:25 | Double d | Switch.cs:27:18:27:25 | Double d | +| Switch.cs:27:18:27:25 | Double d | Switch.cs:27:25:27:25 | access to local variable d | +| Switch.cs:27:25:27:25 | access to local variable d | Switch.cs:27:25:27:25 | access to local variable d | | Switch.cs:27:32:27:38 | call to method Throw | Switch.cs:27:32:27:38 | call to method Throw | | Switch.cs:28:13:28:17 | Label: | Switch.cs:28:13:28:17 | Label: | | Switch.cs:29:17:29:23 | return ...; | Switch.cs:29:17:29:23 | return ...; | @@ -2983,8 +2994,9 @@ | Switch.cs:125:9:126:19 | if (...) ... | Switch.cs:125:9:126:19 | if (...) ... | | Switch.cs:125:13:125:13 | access to parameter o | 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:24:125:29 | Boolean b | Switch.cs:125:24:125:29 | Boolean b | +| Switch.cs:125:24:125:29 | Boolean b | Switch.cs:125:29:125:29 | access to local variable b | | Switch.cs:125:24:125:34 | ... => ... | Switch.cs:125:24:125:34 | ... => ... | +| Switch.cs:125:29:125:29 | access to local variable b | Switch.cs:125:29:125:29 | access to local variable b | | Switch.cs:125:34:125:34 | access to local variable b | Switch.cs:125:34:125:34 | access to local variable b | | Switch.cs:125:37:125:37 | _ | Switch.cs:125:37:125:37 | _ | | Switch.cs:125:37:125:46 | ... => ... | Switch.cs:125:37:125:46 | ... => ... | @@ -2996,8 +3008,9 @@ | Switch.cs:131:16:131:66 | call to method ToString | Switch.cs:131:17:131:53 | ... switch { ... } | | Switch.cs:131:17:131:17 | access to parameter o | 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:28:131:35 | String s | Switch.cs:131:28:131:35 | String s | +| Switch.cs:131:28:131:35 | String s | Switch.cs:131:35:131:35 | access to local variable s | | Switch.cs:131:28:131:40 | ... => ... | Switch.cs:131:28:131:40 | ... => ... | +| Switch.cs:131:35:131:35 | access to local variable s | Switch.cs:131:35:131:35 | access to local variable s | | Switch.cs:131:40:131:40 | access to local variable s | Switch.cs:131:40:131:40 | access to local variable s | | Switch.cs:131:43:131:43 | _ | Switch.cs:131:43:131:43 | _ | | Switch.cs:131:43:131:51 | ... => ... | Switch.cs:131:43:131:51 | ... => ... | @@ -3103,7 +3116,8 @@ | TypeAccesses.cs:7:9:7:25 | if (...) ... | TypeAccesses.cs:7:9:7:25 | if (...) ... | | TypeAccesses.cs:7:13:7:13 | access to parameter o | TypeAccesses.cs:7:13:7:13 | access to parameter o | | TypeAccesses.cs:7:13:7:22 | ... is ... | TypeAccesses.cs:7:13:7:13 | access to parameter o | -| TypeAccesses.cs:7:18:7:22 | Int32 j | TypeAccesses.cs:7:18:7:22 | Int32 j | +| TypeAccesses.cs:7:18:7:22 | Int32 j | TypeAccesses.cs:7:22:7:22 | access to local variable j | +| TypeAccesses.cs:7:22:7:22 | access to local variable j | TypeAccesses.cs:7:22:7:22 | access to local variable j | | TypeAccesses.cs:7:25:7:25 | ; | TypeAccesses.cs:7:25:7:25 | ; | | TypeAccesses.cs:8:9:8:28 | ... ...; | TypeAccesses.cs:8:9:8:28 | ... ...; | | TypeAccesses.cs:8:13:8:13 | access to local variable t | TypeAccesses.cs:8:13:8:13 | access to local variable t | diff --git a/csharp/ql/test/library-tests/controlflow/graph/NodeGraph.expected b/csharp/ql/test/library-tests/controlflow/graph/NodeGraph.expected index d346baeb9593..d13c39477c90 100644 --- a/csharp/ql/test/library-tests/controlflow/graph/NodeGraph.expected +++ b/csharp/ql/test/library-tests/controlflow/graph/NodeGraph.expected @@ -5668,8 +5668,11 @@ | Patterns.cs:8:13:8:23 | After ... is ... [false] | Patterns.cs:12:14:18:9 | if (...) ... | | | Patterns.cs:8:13:8:23 | After ... is ... [true] | Patterns.cs:9:9:11:9 | {...} | | | Patterns.cs:8:13:8:23 | Before ... is ... | Patterns.cs:8:13:8:13 | access to local variable o | | -| Patterns.cs:8:13:8:23 | [MatchTrue] ... is ... | Patterns.cs:8:18:8:23 | Int32 i1 | | -| Patterns.cs:8:18:8:23 | Int32 i1 | Patterns.cs:8:13:8:23 | After ... is ... [true] | true | +| Patterns.cs:8:13:8:23 | [MatchTrue] ... is ... | Patterns.cs:8:18:8:23 | Before Int32 i1 | | +| Patterns.cs:8:18:8:23 | After Int32 i1 | Patterns.cs:8:13:8:23 | After ... is ... [true] | true | +| Patterns.cs:8:18:8:23 | Before Int32 i1 | Patterns.cs:8:22:8:23 | access to local variable i1 | | +| Patterns.cs:8:18:8:23 | Int32 i1 | Patterns.cs:8:18:8:23 | After Int32 i1 | | +| Patterns.cs:8:22:8:23 | access to local variable i1 | Patterns.cs:8:18:8:23 | Int32 i1 | | | Patterns.cs:9:9:11:9 | After {...} | Patterns.cs:8:9:18:9 | After if (...) ... | | | Patterns.cs:9:9:11:9 | {...} | Patterns.cs:10:13:10:43 | ...; | | | Patterns.cs:10:13:10:42 | After call to method WriteLine | Patterns.cs:10:13:10:43 | After ...; | | @@ -5693,8 +5696,11 @@ | Patterns.cs:12:18:12:31 | After ... is ... [false] | Patterns.cs:16:14:18:9 | if (...) ... | | | Patterns.cs:12:18:12:31 | After ... is ... [true] | Patterns.cs:13:9:15:9 | {...} | | | Patterns.cs:12:18:12:31 | Before ... is ... | Patterns.cs:12:18:12:18 | access to local variable o | | -| Patterns.cs:12:18:12:31 | [MatchTrue] ... is ... | Patterns.cs:12:23:12:31 | String s1 | | -| Patterns.cs:12:23:12:31 | String s1 | Patterns.cs:12:18:12:31 | After ... is ... [true] | true | +| Patterns.cs:12:18:12:31 | [MatchTrue] ... is ... | Patterns.cs:12:23:12:31 | Before String s1 | | +| Patterns.cs:12:23:12:31 | After String s1 | Patterns.cs:12:18:12:31 | After ... is ... [true] | true | +| Patterns.cs:12:23:12:31 | Before String s1 | Patterns.cs:12:30:12:31 | access to local variable s1 | | +| Patterns.cs:12:23:12:31 | String s1 | Patterns.cs:12:23:12:31 | After String s1 | | +| Patterns.cs:12:30:12:31 | access to local variable s1 | Patterns.cs:12:23:12:31 | String s1 | | | Patterns.cs:13:9:15:9 | After {...} | Patterns.cs:12:14:18:9 | After if (...) ... | | | Patterns.cs:13:9:15:9 | {...} | Patterns.cs:14:13:14:46 | ...; | | | Patterns.cs:14:13:14:45 | After call to method WriteLine | Patterns.cs:14:13:14:46 | After ...; | | @@ -5718,8 +5724,11 @@ | Patterns.cs:16:18:16:28 | After ... is ... [false] | Patterns.cs:16:14:18:9 | After if (...) ... | | | Patterns.cs:16:18:16:28 | After ... is ... [true] | Patterns.cs:17:9:18:9 | {...} | | | Patterns.cs:16:18:16:28 | Before ... is ... | Patterns.cs:16:18:16:18 | access to local variable o | | -| Patterns.cs:16:18:16:28 | [MatchTrue] ... is ... | Patterns.cs:16:23:16:28 | Object v1 | | -| Patterns.cs:16:23:16:28 | Object v1 | Patterns.cs:16:18:16:28 | After ... is ... [true] | true | +| Patterns.cs:16:18:16:28 | [MatchTrue] ... is ... | Patterns.cs:16:23:16:28 | Before Object v1 | | +| Patterns.cs:16:23:16:28 | After Object v1 | Patterns.cs:16:18:16:28 | After ... is ... [true] | true | +| Patterns.cs:16:23:16:28 | Before Object v1 | Patterns.cs:16:27:16:28 | access to local variable v1 | | +| Patterns.cs:16:23:16:28 | Object v1 | Patterns.cs:16:23:16:28 | After Object v1 | | +| Patterns.cs:16:27:16:28 | access to local variable v1 | Patterns.cs:16:23:16:28 | Object v1 | | | Patterns.cs:17:9:18:9 | {...} | Patterns.cs:16:14:18:9 | After if (...) ... | | | Patterns.cs:20:9:38:9 | After switch (...) {...} | Patterns.cs:40:9:42:9 | switch (...) {...} | | | Patterns.cs:20:9:38:9 | switch (...) {...} | Patterns.cs:20:17:20:17 | access to local variable o | | @@ -5735,11 +5744,13 @@ | Patterns.cs:23:17:23:22 | break; | Patterns.cs:20:9:38:9 | After switch (...) {...} | break | | Patterns.cs:24:13:24:36 | After case ...: [match] | Patterns.cs:24:30:24:35 | Before ... > ... | | | Patterns.cs:24:13:24:36 | After case ...: [no-match] | Patterns.cs:27:13:27:24 | case ...: | | -| Patterns.cs:24:13:24:36 | case ...: | Patterns.cs:24:18:24:23 | Int32 i2 | | +| Patterns.cs:24:13:24:36 | case ...: | Patterns.cs:24:18:24:23 | Before Int32 i2 | | | Patterns.cs:24:18:24:23 | After Int32 i2 [match] | Patterns.cs:24:13:24:36 | After case ...: [match] | match | | Patterns.cs:24:18:24:23 | After Int32 i2 [no-match] | Patterns.cs:24:13:24:36 | After case ...: [no-match] | no-match | +| Patterns.cs:24:18:24:23 | Before Int32 i2 | Patterns.cs:24:22:24:23 | access to local variable i2 | | | Patterns.cs:24:18:24:23 | Int32 i2 | Patterns.cs:24:18:24:23 | After Int32 i2 [match] | match | | Patterns.cs:24:18:24:23 | Int32 i2 | Patterns.cs:24:18:24:23 | After Int32 i2 [no-match] | no-match | +| Patterns.cs:24:22:24:23 | access to local variable i2 | Patterns.cs:24:18:24:23 | Int32 i2 | | | Patterns.cs:24:30:24:31 | access to local variable i2 | Patterns.cs:24:35:24:35 | 0 | | | Patterns.cs:24:30:24:35 | ... > ... | Patterns.cs:24:30:24:35 | After ... > ... [false] | false | | Patterns.cs:24:30:24:35 | ... > ... | Patterns.cs:24:30:24:35 | After ... > ... [true] | true | @@ -5764,11 +5775,13 @@ | Patterns.cs:26:17:26:22 | break; | Patterns.cs:20:9:38:9 | After switch (...) {...} | break | | Patterns.cs:27:13:27:24 | After case ...: [match] | Patterns.cs:28:17:28:47 | ...; | | | Patterns.cs:27:13:27:24 | After case ...: [no-match] | Patterns.cs:30:13:30:27 | case ...: | | -| Patterns.cs:27:13:27:24 | case ...: | Patterns.cs:27:18:27:23 | Int32 i3 | | +| Patterns.cs:27:13:27:24 | case ...: | Patterns.cs:27:18:27:23 | Before Int32 i3 | | | Patterns.cs:27:18:27:23 | After Int32 i3 [match] | Patterns.cs:27:13:27:24 | After case ...: [match] | match | | Patterns.cs:27:18:27:23 | After Int32 i3 [no-match] | Patterns.cs:27:13:27:24 | After case ...: [no-match] | no-match | +| Patterns.cs:27:18:27:23 | Before Int32 i3 | Patterns.cs:27:22:27:23 | access to local variable i3 | | | Patterns.cs:27:18:27:23 | Int32 i3 | Patterns.cs:27:18:27:23 | After Int32 i3 [match] | match | | Patterns.cs:27:18:27:23 | Int32 i3 | Patterns.cs:27:18:27:23 | After Int32 i3 [no-match] | no-match | +| Patterns.cs:27:22:27:23 | access to local variable i3 | Patterns.cs:27:18:27:23 | Int32 i3 | | | Patterns.cs:28:17:28:46 | After call to method WriteLine | Patterns.cs:28:17:28:47 | After ...; | | | Patterns.cs:28:17:28:46 | Before call to method WriteLine | Patterns.cs:28:35:28:45 | Before $"..." | | | Patterns.cs:28:17:28:46 | call to method WriteLine | Patterns.cs:28:17:28:46 | After call to method WriteLine | | @@ -5786,11 +5799,13 @@ | Patterns.cs:29:17:29:22 | break; | Patterns.cs:20:9:38:9 | After switch (...) {...} | break | | Patterns.cs:30:13:30:27 | After case ...: [match] | Patterns.cs:31:17:31:50 | ...; | | | Patterns.cs:30:13:30:27 | After case ...: [no-match] | Patterns.cs:33:13:33:24 | case ...: | | -| Patterns.cs:30:13:30:27 | case ...: | Patterns.cs:30:18:30:26 | String s2 | | +| Patterns.cs:30:13:30:27 | case ...: | Patterns.cs:30:18:30:26 | Before String s2 | | | Patterns.cs:30:18:30:26 | After String s2 [match] | Patterns.cs:30:13:30:27 | After case ...: [match] | match | | Patterns.cs:30:18:30:26 | After String s2 [no-match] | Patterns.cs:30:13:30:27 | After case ...: [no-match] | no-match | +| Patterns.cs:30:18:30:26 | Before String s2 | Patterns.cs:30:25:30:26 | access to local variable s2 | | | Patterns.cs:30:18:30:26 | String s2 | Patterns.cs:30:18:30:26 | After String s2 [match] | match | | Patterns.cs:30:18:30:26 | String s2 | Patterns.cs:30:18:30:26 | After String s2 [no-match] | no-match | +| Patterns.cs:30:25:30:26 | access to local variable s2 | Patterns.cs:30:18:30:26 | String s2 | | | Patterns.cs:31:17:31:49 | After call to method WriteLine | Patterns.cs:31:17:31:50 | After ...; | | | Patterns.cs:31:17:31:49 | Before call to method WriteLine | Patterns.cs:31:35:31:48 | Before $"..." | | | Patterns.cs:31:17:31:49 | call to method WriteLine | Patterns.cs:31:17:31:49 | After call to method WriteLine | | @@ -5808,11 +5823,13 @@ | Patterns.cs:32:17:32:22 | break; | Patterns.cs:20:9:38:9 | After switch (...) {...} | break | | Patterns.cs:33:13:33:24 | After case ...: [match] | Patterns.cs:34:17:34:22 | Before break; | | | Patterns.cs:33:13:33:24 | After case ...: [no-match] | Patterns.cs:35:13:35:20 | default: | | -| Patterns.cs:33:13:33:24 | case ...: | Patterns.cs:33:18:33:23 | Object v2 | | +| Patterns.cs:33:13:33:24 | case ...: | Patterns.cs:33:18:33:23 | Before Object v2 | | | Patterns.cs:33:18:33:23 | After Object v2 [match] | Patterns.cs:33:13:33:24 | After case ...: [match] | match | | Patterns.cs:33:18:33:23 | After Object v2 [no-match] | Patterns.cs:33:13:33:24 | After case ...: [no-match] | no-match | +| Patterns.cs:33:18:33:23 | Before Object v2 | Patterns.cs:33:22:33:23 | access to local variable v2 | | | Patterns.cs:33:18:33:23 | Object v2 | Patterns.cs:33:18:33:23 | After Object v2 [match] | match | | Patterns.cs:33:18:33:23 | Object v2 | Patterns.cs:33:18:33:23 | After Object v2 [no-match] | no-match | +| Patterns.cs:33:22:33:23 | access to local variable v2 | Patterns.cs:33:18:33:23 | Object v2 | | | Patterns.cs:34:17:34:22 | Before break; | Patterns.cs:34:17:34:22 | break; | | | Patterns.cs:34:17:34:22 | break; | Patterns.cs:20:9:38:9 | After switch (...) {...} | break | | Patterns.cs:35:13:35:20 | After default: [match] | Patterns.cs:36:17:36:52 | ...; | | @@ -5884,14 +5901,17 @@ | Patterns.cs:54:14:54:37 | Before not ... | Patterns.cs:54:18:54:37 | Before { ... } | | | Patterns.cs:54:14:54:37 | not ... | Patterns.cs:54:14:54:37 | After not ... | | | Patterns.cs:54:18:54:25 | access to type Patterns | Patterns.cs:54:27:54:35 | Before { ... } | | +| Patterns.cs:54:18:54:37 | After Patterns u | Patterns.cs:54:18:54:25 | access to type Patterns | | | Patterns.cs:54:18:54:37 | After { ... } | Patterns.cs:54:14:54:37 | not ... | | -| Patterns.cs:54:18:54:37 | Before { ... } | Patterns.cs:54:18:54:37 | Patterns u | | -| Patterns.cs:54:18:54:37 | Patterns u | Patterns.cs:54:18:54:25 | access to type Patterns | | +| Patterns.cs:54:18:54:37 | Before Patterns u | Patterns.cs:54:37:54:37 | access to local variable u | | +| Patterns.cs:54:18:54:37 | Before { ... } | Patterns.cs:54:18:54:37 | Before Patterns u | | +| Patterns.cs:54:18:54:37 | Patterns u | Patterns.cs:54:18:54:37 | After Patterns u | | | Patterns.cs:54:18:54:37 | { ... } | Patterns.cs:54:18:54:37 | After { ... } | | | Patterns.cs:54:27:54:35 | After { ... } | Patterns.cs:54:18:54:37 | { ... } | | | Patterns.cs:54:27:54:35 | Before { ... } | Patterns.cs:54:33:54:33 | 1 | | | Patterns.cs:54:27:54:35 | { ... } | Patterns.cs:54:27:54:35 | After { ... } | | | Patterns.cs:54:33:54:33 | 1 | Patterns.cs:54:27:54:35 | { ... } | | +| Patterns.cs:54:37:54:37 | access to local variable u | Patterns.cs:54:18:54:37 | Patterns u | | | Patterns.cs:56:26:56:27 | Entry | Patterns.cs:56:33:56:33 | i | | | Patterns.cs:56:26:56:27 | Normal Exit | Patterns.cs:56:26:56:27 | Exit | | | Patterns.cs:56:33:56:33 | i | Patterns.cs:57:5:63:5 | {...} | | @@ -6353,11 +6373,13 @@ | Switch.cs:19:17:19:29 | goto default; | Switch.cs:30:13:30:20 | After default: [match] | goto | | Switch.cs:20:13:20:23 | After case ...: [match] | Switch.cs:21:17:22:27 | if (...) ... | | | Switch.cs:20:13:20:23 | After case ...: [no-match] | Switch.cs:24:13:24:56 | case ...: | | -| Switch.cs:20:13:20:23 | case ...: | Switch.cs:20:18:20:22 | Int32 i | | +| Switch.cs:20:13:20:23 | case ...: | Switch.cs:20:18:20:22 | Before Int32 i | | | Switch.cs:20:18:20:22 | After Int32 i [match] | Switch.cs:20:13:20:23 | After case ...: [match] | match | | Switch.cs:20:18:20:22 | After Int32 i [no-match] | Switch.cs:20:13:20:23 | After case ...: [no-match] | no-match | +| Switch.cs:20:18:20:22 | Before Int32 i | Switch.cs:20:22:20:22 | access to local variable i | | | Switch.cs:20:18:20:22 | Int32 i | Switch.cs:20:18:20:22 | After Int32 i [match] | match | | Switch.cs:20:18:20:22 | Int32 i | Switch.cs:20:18:20:22 | After Int32 i [no-match] | no-match | +| Switch.cs:20:22:20:22 | access to local variable i | Switch.cs:20:18:20:22 | Int32 i | | | Switch.cs:21:17:22:27 | After if (...) ... | Switch.cs:23:17:23:28 | Before goto case ...; | | | Switch.cs:21:17:22:27 | if (...) ... | Switch.cs:21:21:21:29 | Before ... == ... | | | Switch.cs:21:21:21:21 | access to parameter o | Switch.cs:21:26:21:29 | null | | @@ -6374,11 +6396,13 @@ | Switch.cs:23:27:23:27 | 0 | Switch.cs:23:17:23:28 | goto case ...; | | | Switch.cs:24:13:24:56 | After case ...: [match] | Switch.cs:24:32:24:55 | ... && ... | | | Switch.cs:24:13:24:56 | After case ...: [no-match] | Switch.cs:27:13:27:39 | case ...: | | -| Switch.cs:24:13:24:56 | case ...: | Switch.cs:24:18:24:25 | String s | | +| Switch.cs:24:13:24:56 | case ...: | Switch.cs:24:18:24:25 | Before String s | | | Switch.cs:24:18:24:25 | After String s [match] | Switch.cs:24:13:24:56 | After case ...: [match] | match | | Switch.cs:24:18:24:25 | After String s [no-match] | Switch.cs:24:13:24:56 | After case ...: [no-match] | no-match | +| Switch.cs:24:18:24:25 | Before String s | Switch.cs:24:25:24:25 | access to local variable s | | | Switch.cs:24:18:24:25 | String s | Switch.cs:24:18:24:25 | After String s [match] | match | | Switch.cs:24:18:24:25 | String s | Switch.cs:24:18:24:25 | After String s [no-match] | no-match | +| Switch.cs:24:25:24:25 | access to local variable s | Switch.cs:24:18:24:25 | String s | | | Switch.cs:24:32:24:32 | access to local variable s | Switch.cs:24:32:24:39 | access to property Length | | | Switch.cs:24:32:24:39 | After access to property Length | Switch.cs:24:43:24:43 | 0 | | | Switch.cs:24:32:24:39 | Before access to property Length | Switch.cs:24:32:24:32 | access to local variable s | | @@ -6409,11 +6433,13 @@ | Switch.cs:26:17:26:23 | return ...; | Switch.cs:10:10:10:11 | Normal Exit | return | | Switch.cs:27:13:27:39 | After case ...: [match] | Switch.cs:27:32:27:38 | Before call to method Throw | | | Switch.cs:27:13:27:39 | After case ...: [no-match] | Switch.cs:30:13:30:20 | default: | | -| Switch.cs:27:13:27:39 | case ...: | Switch.cs:27:18:27:25 | Double d | | +| Switch.cs:27:13:27:39 | case ...: | Switch.cs:27:18:27:25 | Before Double d | | | Switch.cs:27:18:27:25 | After Double d [match] | Switch.cs:27:13:27:39 | After case ...: [match] | match | | Switch.cs:27:18:27:25 | After Double d [no-match] | Switch.cs:27:13:27:39 | After case ...: [no-match] | no-match | +| Switch.cs:27:18:27:25 | Before Double d | Switch.cs:27:25:27:25 | access to local variable d | | | Switch.cs:27:18:27:25 | Double d | Switch.cs:27:18:27:25 | After Double d [match] | match | | Switch.cs:27:18:27:25 | Double d | Switch.cs:27:18:27:25 | After Double d [no-match] | no-match | +| Switch.cs:27:25:27:25 | access to local variable d | Switch.cs:27:18:27:25 | Double d | | | Switch.cs:27:32:27:38 | Before call to method Throw | Switch.cs:27:32:27:38 | call to method Throw | | | Switch.cs:27:32:27:38 | call to method Throw | Switch.cs:10:10:10:11 | Exceptional Exit | exception | | Switch.cs:28:13:28:17 | Label: | Switch.cs:29:17:29:23 | Before return ...; | | @@ -6691,11 +6717,13 @@ | Switch.cs:125:13:125:48 | After ... switch { ... } [true] | Switch.cs:126:13:126:19 | Before return ...; | | | Switch.cs:125:24:125:29 | After Boolean b [match] | Switch.cs:125:24:125:34 | After ... => ... [match] | match | | Switch.cs:125:24:125:29 | After Boolean b [no-match] | Switch.cs:125:24:125:34 | After ... => ... [no-match] | no-match | +| Switch.cs:125:24:125:29 | Before Boolean b | Switch.cs:125:29:125:29 | access to local variable b | | | Switch.cs:125:24:125:29 | Boolean b | Switch.cs:125:24:125:29 | After Boolean b [match] | match | | Switch.cs:125:24:125:29 | Boolean b | Switch.cs:125:24:125:29 | After Boolean b [no-match] | no-match | -| Switch.cs:125:24:125:34 | ... => ... | Switch.cs:125:24:125:29 | Boolean b | | +| Switch.cs:125:24:125:34 | ... => ... | Switch.cs:125:24:125:29 | Before 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:29:125:29 | access to local variable b | Switch.cs:125:24:125:29 | Boolean b | | | 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 | @@ -6723,11 +6751,13 @@ | 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:28:131:40 | After ... => ... [match] | match | | Switch.cs:131:28:131:35 | After String s [no-match] | Switch.cs:131:28:131:40 | After ... => ... [no-match] | no-match | +| Switch.cs:131:28:131:35 | Before String s | Switch.cs:131:35:131:35 | access to local variable s | | | Switch.cs:131:28:131:35 | String s | Switch.cs:131:28:131:35 | After String s [match] | match | | Switch.cs:131:28:131:35 | String s | Switch.cs:131:28:131:35 | After String s [no-match] | no-match | -| Switch.cs:131:28:131:40 | ... => ... | Switch.cs:131:28:131:35 | String s | | +| Switch.cs:131:28:131:40 | ... => ... | Switch.cs:131:28:131:35 | Before 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:35:131:35 | access to local variable s | Switch.cs:131:28:131:35 | String s | | | 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 | @@ -6968,8 +6998,11 @@ | TypeAccesses.cs:7:13:7:22 | After ... is ... [false] | TypeAccesses.cs:7:9:7:25 | After if (...) ... | | | TypeAccesses.cs:7:13:7:22 | After ... is ... [true] | TypeAccesses.cs:7:25:7:25 | ; | | | TypeAccesses.cs:7:13:7:22 | Before ... is ... | TypeAccesses.cs:7:13:7:13 | access to parameter o | | -| TypeAccesses.cs:7:13:7:22 | [MatchTrue] ... is ... | TypeAccesses.cs:7:18:7:22 | Int32 j | | -| TypeAccesses.cs:7:18:7:22 | Int32 j | TypeAccesses.cs:7:13:7:22 | After ... is ... [true] | true | +| TypeAccesses.cs:7:13:7:22 | [MatchTrue] ... is ... | TypeAccesses.cs:7:18:7:22 | Before Int32 j | | +| TypeAccesses.cs:7:18:7:22 | After Int32 j | TypeAccesses.cs:7:13:7:22 | After ... is ... [true] | true | +| TypeAccesses.cs:7:18:7:22 | Before Int32 j | TypeAccesses.cs:7:22:7:22 | access to local variable j | | +| TypeAccesses.cs:7:18:7:22 | Int32 j | TypeAccesses.cs:7:18:7:22 | After Int32 j | | +| TypeAccesses.cs:7:22:7:22 | access to local variable j | TypeAccesses.cs:7:18:7:22 | Int32 j | | | TypeAccesses.cs:7:25:7:25 | ; | TypeAccesses.cs:7:9:7:25 | After if (...) ... | | | TypeAccesses.cs:8:9:8:28 | ... ...; | TypeAccesses.cs:8:13:8:27 | Before Type t = ... | | | TypeAccesses.cs:8:9:8:28 | After ... ...; | TypeAccesses.cs:4:5:9:5 | After {...} | | diff --git a/csharp/ql/test/library-tests/csharp11/PrintAst.expected b/csharp/ql/test/library-tests/csharp11/PrintAst.expected index cf501daa763c..74cec4d6f4a8 100644 --- a/csharp/ql/test/library-tests/csharp11/PrintAst.expected +++ b/csharp/ql/test/library-tests/csharp11/PrintAst.expected @@ -396,6 +396,7 @@ ListPattern.cs: # 10| 0: [ParameterAccess] access to parameter x # 10| 1: [ListPatternExpr] [ ... ] # 10| 0: [VariablePatternExpr] Int32 y +# 10| 0: [LocalVariableAccess] access to local variable y # 10| 1: [ConstantPatternExpr,IntLiteral] 3 # 10| 2: [ConstantPatternExpr,IntLiteral] 4 # 10| 1: [BlockStmt] {...} @@ -414,6 +415,7 @@ ListPattern.cs: # 12| 0: [ParameterAccess] access to parameter x # 12| 1: [ListPatternExpr] [ ... ] # 12| 0: [VariablePatternExpr] Int32 a +# 12| 0: [LocalVariableAccess] access to local variable a # 12| 1: [SlicePatternExpr] .. # 12| 2: [ConstantPatternExpr,IntLiteral] 2 # 12| 1: [BlockStmt] {...} @@ -422,6 +424,7 @@ ListPattern.cs: # 13| 0: [ParameterAccess] access to parameter x # 13| 1: [ListPatternExpr] [ ... ] # 13| 0: [VariablePatternExpr] Int32 b +# 13| 0: [LocalVariableAccess] access to local variable b # 13| 1: [SlicePatternExpr] .. # 13| 0: [RecursivePatternExpr] { ... } # 13| 3: [PropertyPatternExpr] { ... } @@ -454,6 +457,7 @@ ListPattern.cs: # 26| 6: [CaseStmt] case ...: # 26| 0: [ListPatternExpr] [ ... ] # 26| 0: [VariablePatternExpr] String y +# 26| 0: [LocalVariableAccess] access to local variable y # 26| 1: [ConstantPatternExpr,StringLiteralUtf16] "C" # 26| 2: [ConstantPatternExpr,StringLiteralUtf16] "D" # 27| 7: [BreakStmt] break; @@ -468,14 +472,17 @@ ListPattern.cs: # 30| 10: [CaseStmt] case ...: # 30| 0: [ListPatternExpr] [ ... ] # 30| 0: [VariablePatternExpr] String a +# 30| 0: [LocalVariableAccess] access to local variable a # 30| 1: [SlicePatternExpr] .. # 30| 2: [ConstantPatternExpr,StringLiteralUtf16] "H" # 31| 11: [BreakStmt] break; # 32| 12: [CaseStmt] case ...: # 32| 0: [ListPatternExpr] [ ... ] # 32| 0: [VariablePatternExpr] String b +# 32| 0: [LocalVariableAccess] access to local variable b # 32| 1: [SlicePatternExpr] .. # 32| 0: [VariablePatternExpr] String[] c +# 32| 0: [LocalVariableAccess] access to local variable c # 32| 2: [ConstantPatternExpr,StringLiteralUtf16] "I" # 33| 13: [BreakStmt] break; # 34| 14: [DefaultCase] default: diff --git a/csharp/ql/test/library-tests/csharp7/IsFlow.expected b/csharp/ql/test/library-tests/csharp7/IsFlow.expected index 07d3079854d6..06d2212d019e 100644 --- a/csharp/ql/test/library-tests/csharp7/IsFlow.expected +++ b/csharp/ql/test/library-tests/csharp7/IsFlow.expected @@ -41,8 +41,11 @@ | CSharp7.cs:254:27:254:40 | After ... is ... [false] | CSharp7.cs:257:13:257:36 | case ...: | semmle.label | successor | | CSharp7.cs:254:27:254:40 | After ... is ... [true] | CSharp7.cs:255:17:255:45 | ...; | semmle.label | successor | | CSharp7.cs:254:27:254:40 | Before ... is ... | CSharp7.cs:254:27:254:27 | access to local variable o | semmle.label | successor | -| CSharp7.cs:254:27:254:40 | [MatchTrue] ... is ... | CSharp7.cs:254:32:254:40 | String s4 | semmle.label | successor | -| CSharp7.cs:254:32:254:40 | String s4 | CSharp7.cs:254:27:254:40 | After ... is ... [true] | semmle.label | true | +| CSharp7.cs:254:27:254:40 | [MatchTrue] ... is ... | CSharp7.cs:254:32:254:40 | Before String s4 | semmle.label | successor | +| CSharp7.cs:254:32:254:40 | After String s4 | CSharp7.cs:254:27:254:40 | After ... is ... [true] | semmle.label | true | +| CSharp7.cs:254:32:254:40 | Before String s4 | CSharp7.cs:254:39:254:40 | access to local variable s4 | semmle.label | successor | +| CSharp7.cs:254:32:254:40 | String s4 | CSharp7.cs:254:32:254:40 | After String s4 | semmle.label | successor | +| CSharp7.cs:254:39:254:40 | access to local variable s4 | CSharp7.cs:254:32:254:40 | String s4 | semmle.label | successor | | CSharp7.cs:255:17:255:44 | After call to method WriteLine | CSharp7.cs:255:17:255:45 | After ...; | semmle.label | successor | | CSharp7.cs:255:17:255:44 | Before call to method WriteLine | CSharp7.cs:255:35:255:43 | Before $"..." | semmle.label | successor | | CSharp7.cs:255:17:255:44 | call to method WriteLine | CSharp7.cs:255:17:255:44 | After call to method WriteLine | semmle.label | successor | @@ -60,11 +63,13 @@ | CSharp7.cs:256:17:256:22 | break; | CSharp7.cs:248:9:274:9 | After switch (...) {...} | semmle.label | break | | CSharp7.cs:257:13:257:36 | After case ...: [match] | CSharp7.cs:257:30:257:35 | Before ... > ... | semmle.label | successor | | CSharp7.cs:257:13:257:36 | After case ...: [no-match] | CSharp7.cs:260:13:260:24 | case ...: | semmle.label | successor | -| CSharp7.cs:257:13:257:36 | case ...: | CSharp7.cs:257:18:257:23 | Int32 i2 | semmle.label | successor | +| CSharp7.cs:257:13:257:36 | case ...: | CSharp7.cs:257:18:257:23 | Before Int32 i2 | semmle.label | successor | | CSharp7.cs:257:18:257:23 | After Int32 i2 [match] | CSharp7.cs:257:13:257:36 | After case ...: [match] | semmle.label | match | | CSharp7.cs:257:18:257:23 | After Int32 i2 [no-match] | CSharp7.cs:257:13:257:36 | After case ...: [no-match] | semmle.label | no-match | +| CSharp7.cs:257:18:257:23 | Before Int32 i2 | CSharp7.cs:257:22:257:23 | access to local variable i2 | semmle.label | successor | | CSharp7.cs:257:18:257:23 | Int32 i2 | CSharp7.cs:257:18:257:23 | After Int32 i2 [match] | semmle.label | match | | CSharp7.cs:257:18:257:23 | Int32 i2 | CSharp7.cs:257:18:257:23 | After Int32 i2 [no-match] | semmle.label | no-match | +| CSharp7.cs:257:22:257:23 | access to local variable i2 | CSharp7.cs:257:18:257:23 | Int32 i2 | semmle.label | successor | | CSharp7.cs:257:30:257:31 | access to local variable i2 | CSharp7.cs:257:35:257:35 | 0 | semmle.label | successor | | CSharp7.cs:257:30:257:35 | ... > ... | CSharp7.cs:257:30:257:35 | After ... > ... [false] | semmle.label | false | | CSharp7.cs:257:30:257:35 | ... > ... | CSharp7.cs:257:30:257:35 | After ... > ... [true] | semmle.label | true | @@ -89,11 +94,13 @@ | CSharp7.cs:259:17:259:22 | break; | CSharp7.cs:248:9:274:9 | After switch (...) {...} | semmle.label | break | | CSharp7.cs:260:13:260:24 | After case ...: [match] | CSharp7.cs:261:17:261:47 | ...; | semmle.label | successor | | CSharp7.cs:260:13:260:24 | After case ...: [no-match] | CSharp7.cs:263:13:263:27 | case ...: | semmle.label | successor | -| CSharp7.cs:260:13:260:24 | case ...: | CSharp7.cs:260:18:260:23 | Int32 i3 | semmle.label | successor | +| CSharp7.cs:260:13:260:24 | case ...: | CSharp7.cs:260:18:260:23 | Before Int32 i3 | semmle.label | successor | | CSharp7.cs:260:18:260:23 | After Int32 i3 [match] | CSharp7.cs:260:13:260:24 | After case ...: [match] | semmle.label | match | | CSharp7.cs:260:18:260:23 | After Int32 i3 [no-match] | CSharp7.cs:260:13:260:24 | After case ...: [no-match] | semmle.label | no-match | +| CSharp7.cs:260:18:260:23 | Before Int32 i3 | CSharp7.cs:260:22:260:23 | access to local variable i3 | semmle.label | successor | | CSharp7.cs:260:18:260:23 | Int32 i3 | CSharp7.cs:260:18:260:23 | After Int32 i3 [match] | semmle.label | match | | CSharp7.cs:260:18:260:23 | Int32 i3 | CSharp7.cs:260:18:260:23 | After Int32 i3 [no-match] | semmle.label | no-match | +| CSharp7.cs:260:22:260:23 | access to local variable i3 | CSharp7.cs:260:18:260:23 | Int32 i3 | semmle.label | successor | | CSharp7.cs:261:17:261:46 | After call to method WriteLine | CSharp7.cs:261:17:261:47 | After ...; | semmle.label | successor | | CSharp7.cs:261:17:261:46 | Before call to method WriteLine | CSharp7.cs:261:35:261:45 | Before $"..." | semmle.label | successor | | CSharp7.cs:261:17:261:46 | call to method WriteLine | CSharp7.cs:261:17:261:46 | After call to method WriteLine | semmle.label | successor | @@ -111,11 +118,13 @@ | CSharp7.cs:262:17:262:22 | break; | CSharp7.cs:248:9:274:9 | After switch (...) {...} | semmle.label | break | | CSharp7.cs:263:13:263:27 | After case ...: [match] | CSharp7.cs:264:17:264:50 | ...; | semmle.label | successor | | CSharp7.cs:263:13:263:27 | After case ...: [no-match] | CSharp7.cs:266:13:266:26 | case ...: | semmle.label | successor | -| CSharp7.cs:263:13:263:27 | case ...: | CSharp7.cs:263:18:263:26 | String s2 | semmle.label | successor | +| CSharp7.cs:263:13:263:27 | case ...: | CSharp7.cs:263:18:263:26 | Before String s2 | semmle.label | successor | | CSharp7.cs:263:18:263:26 | After String s2 [match] | CSharp7.cs:263:13:263:27 | After case ...: [match] | semmle.label | match | | CSharp7.cs:263:18:263:26 | After String s2 [no-match] | CSharp7.cs:263:13:263:27 | After case ...: [no-match] | semmle.label | no-match | +| CSharp7.cs:263:18:263:26 | Before String s2 | CSharp7.cs:263:25:263:26 | access to local variable s2 | semmle.label | successor | | CSharp7.cs:263:18:263:26 | String s2 | CSharp7.cs:263:18:263:26 | After String s2 [match] | semmle.label | match | | CSharp7.cs:263:18:263:26 | String s2 | CSharp7.cs:263:18:263:26 | After String s2 [no-match] | semmle.label | no-match | +| CSharp7.cs:263:25:263:26 | access to local variable s2 | CSharp7.cs:263:18:263:26 | String s2 | semmle.label | successor | | CSharp7.cs:264:17:264:49 | After call to method WriteLine | CSharp7.cs:264:17:264:50 | After ...; | semmle.label | successor | | CSharp7.cs:264:17:264:49 | Before call to method WriteLine | CSharp7.cs:264:35:264:48 | Before $"..." | semmle.label | successor | | CSharp7.cs:264:17:264:49 | call to method WriteLine | CSharp7.cs:264:17:264:49 | After call to method WriteLine | semmle.label | successor | @@ -148,11 +157,13 @@ | CSharp7.cs:268:17:268:22 | break; | CSharp7.cs:248:9:274:9 | After switch (...) {...} | semmle.label | break | | CSharp7.cs:269:13:269:24 | After case ...: [match] | CSharp7.cs:270:17:270:22 | Before break; | semmle.label | successor | | CSharp7.cs:269:13:269:24 | After case ...: [no-match] | CSharp7.cs:271:13:271:20 | default: | semmle.label | successor | -| CSharp7.cs:269:13:269:24 | case ...: | CSharp7.cs:269:18:269:23 | Object v2 | semmle.label | successor | +| CSharp7.cs:269:13:269:24 | case ...: | CSharp7.cs:269:18:269:23 | Before Object v2 | semmle.label | successor | | CSharp7.cs:269:18:269:23 | After Object v2 [match] | CSharp7.cs:269:13:269:24 | After case ...: [match] | semmle.label | match | | CSharp7.cs:269:18:269:23 | After Object v2 [no-match] | CSharp7.cs:269:13:269:24 | After case ...: [no-match] | semmle.label | no-match | +| CSharp7.cs:269:18:269:23 | Before Object v2 | CSharp7.cs:269:22:269:23 | access to local variable v2 | semmle.label | successor | | CSharp7.cs:269:18:269:23 | Object v2 | CSharp7.cs:269:18:269:23 | After Object v2 [match] | semmle.label | match | | CSharp7.cs:269:18:269:23 | Object v2 | CSharp7.cs:269:18:269:23 | After Object v2 [no-match] | semmle.label | no-match | +| CSharp7.cs:269:22:269:23 | access to local variable v2 | CSharp7.cs:269:18:269:23 | Object v2 | semmle.label | successor | | CSharp7.cs:270:17:270:22 | Before break; | CSharp7.cs:270:17:270:22 | break; | semmle.label | successor | | CSharp7.cs:270:17:270:22 | break; | CSharp7.cs:248:9:274:9 | After switch (...) {...} | semmle.label | break | | CSharp7.cs:271:13:271:20 | After default: [match] | CSharp7.cs:272:17:272:52 | ...; | semmle.label | successor | diff --git a/csharp/ql/test/library-tests/csharp7/LocalTaintFlow.expected b/csharp/ql/test/library-tests/csharp7/LocalTaintFlow.expected index e2d3b18e0366..04b1bed9d3e0 100644 --- a/csharp/ql/test/library-tests/csharp7/LocalTaintFlow.expected +++ b/csharp/ql/test/library-tests/csharp7/LocalTaintFlow.expected @@ -250,12 +250,12 @@ | CSharp7.cs:232:16:232:16 | access to local variable o | CSharp7.cs:232:16:232:23 | SSA def(o) | | CSharp7.cs:232:16:232:23 | SSA def(o) | CSharp7.cs:233:13:233:13 | access to local variable o | | CSharp7.cs:232:20:232:23 | null | CSharp7.cs:232:16:232:16 | access to local variable o | -| CSharp7.cs:233:13:233:13 | access to local variable o | CSharp7.cs:233:18:233:23 | Int32 i1 | +| CSharp7.cs:233:13:233:13 | access to local variable o | CSharp7.cs:233:22:233:23 | access to local variable i1 | | CSharp7.cs:233:13:233:13 | access to local variable o | CSharp7.cs:234:9:236:9 | [input] SSA phi read(o) | | CSharp7.cs:233:13:233:13 | access to local variable o | CSharp7.cs:237:18:237:18 | access to local variable o | | CSharp7.cs:233:13:233:23 | ... is ... | CSharp7.cs:233:13:233:33 | ... && ... | -| CSharp7.cs:233:18:233:23 | Int32 i1 | CSharp7.cs:233:18:233:23 | SSA def(i1) | | CSharp7.cs:233:18:233:23 | SSA def(i1) | CSharp7.cs:233:28:233:29 | access to local variable i1 | +| CSharp7.cs:233:22:233:23 | access to local variable i1 | CSharp7.cs:233:18:233:23 | SSA def(i1) | | CSharp7.cs:233:28:233:29 | access to local variable i1 | CSharp7.cs:233:28:233:33 | ... > ... | | CSharp7.cs:233:28:233:29 | access to local variable i1 | CSharp7.cs:235:38:235:39 | access to local variable i1 | | CSharp7.cs:233:28:233:33 | ... > ... | CSharp7.cs:233:13:233:33 | ... && ... | @@ -263,11 +263,11 @@ | CSharp7.cs:235:33:235:36 | "int " | CSharp7.cs:235:31:235:41 | $"..." | | CSharp7.cs:235:37:235:40 | {...} | CSharp7.cs:235:31:235:41 | $"..." | | CSharp7.cs:235:38:235:39 | access to local variable i1 | CSharp7.cs:235:37:235:40 | {...} | -| CSharp7.cs:237:18:237:18 | access to local variable o | CSharp7.cs:237:23:237:31 | String s1 | +| CSharp7.cs:237:18:237:18 | access to local variable o | CSharp7.cs:237:30:237:31 | access to local variable s1 | | CSharp7.cs:237:18:237:18 | access to local variable o | CSharp7.cs:238:9:240:9 | [input] SSA phi read(o) | | CSharp7.cs:237:18:237:18 | access to local variable o | CSharp7.cs:241:18:241:18 | access to local variable o | | CSharp7.cs:237:23:237:31 | SSA def(s1) | CSharp7.cs:239:41:239:42 | access to local variable s1 | -| CSharp7.cs:237:23:237:31 | String s1 | CSharp7.cs:237:23:237:31 | SSA def(s1) | +| CSharp7.cs:237:30:237:31 | access to local variable s1 | CSharp7.cs:237:23:237:31 | SSA def(s1) | | CSharp7.cs:238:9:240:9 | [input] SSA phi read(o) | CSharp7.cs:248:17:248:17 | access to local variable o | | CSharp7.cs:239:33:239:39 | "string " | CSharp7.cs:239:31:239:44 | $"..." | | CSharp7.cs:239:40:239:43 | {...} | CSharp7.cs:239:31:239:44 | $"..." | @@ -275,35 +275,35 @@ | CSharp7.cs:241:18:241:18 | access to local variable o | CSharp7.cs:242:9:243:9 | [input] SSA phi read(o) | | CSharp7.cs:241:18:241:18 | access to local variable o | CSharp7.cs:244:18:244:18 | access to local variable o | | CSharp7.cs:242:9:243:9 | [input] SSA phi read(o) | CSharp7.cs:248:17:248:17 | access to local variable o | -| CSharp7.cs:244:18:244:18 | access to local variable o | CSharp7.cs:244:23:244:28 | Object v1 | +| CSharp7.cs:244:18:244:18 | access to local variable o | CSharp7.cs:244:27:244:28 | access to local variable v1 | | CSharp7.cs:244:18:244:18 | access to local variable o | CSharp7.cs:248:17:248:17 | access to local variable o | | CSharp7.cs:248:17:248:17 | access to local variable o | CSharp7.cs:254:27:254:27 | access to local variable o | -| CSharp7.cs:248:17:248:17 | access to local variable o | CSharp7.cs:257:18:257:23 | Int32 i2 | -| CSharp7.cs:248:17:248:17 | access to local variable o | CSharp7.cs:260:18:260:23 | Int32 i3 | -| CSharp7.cs:248:17:248:17 | access to local variable o | CSharp7.cs:263:18:263:26 | String s2 | -| CSharp7.cs:248:17:248:17 | access to local variable o | CSharp7.cs:269:18:269:23 | Object v2 | +| CSharp7.cs:248:17:248:17 | access to local variable o | CSharp7.cs:257:22:257:23 | access to local variable i2 | +| CSharp7.cs:248:17:248:17 | access to local variable o | CSharp7.cs:260:22:260:23 | access to local variable i3 | +| CSharp7.cs:248:17:248:17 | access to local variable o | CSharp7.cs:263:25:263:26 | access to local variable s2 | +| CSharp7.cs:248:17:248:17 | access to local variable o | CSharp7.cs:269:22:269:23 | access to local variable v2 | | CSharp7.cs:252:26:252:26 | 1 | CSharp7.cs:252:26:252:30 | ... < ... | | CSharp7.cs:252:30:252:30 | 2 | CSharp7.cs:252:26:252:30 | ... < ... | -| CSharp7.cs:254:27:254:27 | access to local variable o | CSharp7.cs:254:32:254:40 | String s4 | +| CSharp7.cs:254:27:254:27 | access to local variable o | CSharp7.cs:254:39:254:40 | access to local variable s4 | | CSharp7.cs:254:32:254:40 | SSA def(s4) | CSharp7.cs:255:40:255:41 | access to local variable s4 | -| CSharp7.cs:254:32:254:40 | String s4 | CSharp7.cs:254:32:254:40 | SSA def(s4) | +| CSharp7.cs:254:39:254:40 | access to local variable s4 | CSharp7.cs:254:32:254:40 | SSA def(s4) | | CSharp7.cs:255:37:255:38 | "x " | CSharp7.cs:255:35:255:43 | $"..." | | CSharp7.cs:255:39:255:42 | {...} | CSharp7.cs:255:35:255:43 | $"..." | | CSharp7.cs:255:40:255:41 | access to local variable s4 | CSharp7.cs:255:39:255:42 | {...} | -| CSharp7.cs:257:18:257:23 | Int32 i2 | CSharp7.cs:257:18:257:23 | SSA def(i2) | | CSharp7.cs:257:18:257:23 | SSA def(i2) | CSharp7.cs:257:30:257:31 | access to local variable i2 | +| CSharp7.cs:257:22:257:23 | access to local variable i2 | CSharp7.cs:257:18:257:23 | SSA def(i2) | | CSharp7.cs:257:30:257:31 | access to local variable i2 | CSharp7.cs:257:30:257:35 | ... > ... | | CSharp7.cs:257:30:257:31 | access to local variable i2 | CSharp7.cs:258:47:258:48 | access to local variable i2 | | CSharp7.cs:258:37:258:45 | "positive " | CSharp7.cs:258:35:258:50 | $"..." | | CSharp7.cs:258:46:258:49 | {...} | CSharp7.cs:258:35:258:50 | $"..." | | CSharp7.cs:258:47:258:48 | access to local variable i2 | CSharp7.cs:258:46:258:49 | {...} | -| CSharp7.cs:260:18:260:23 | Int32 i3 | CSharp7.cs:260:18:260:23 | SSA def(i3) | | CSharp7.cs:260:18:260:23 | SSA def(i3) | CSharp7.cs:261:42:261:43 | access to local variable i3 | +| CSharp7.cs:260:22:260:23 | access to local variable i3 | CSharp7.cs:260:18:260:23 | SSA def(i3) | | CSharp7.cs:261:37:261:40 | "int " | CSharp7.cs:261:35:261:45 | $"..." | | CSharp7.cs:261:41:261:44 | {...} | CSharp7.cs:261:35:261:45 | $"..." | | CSharp7.cs:261:42:261:43 | access to local variable i3 | CSharp7.cs:261:41:261:44 | {...} | | CSharp7.cs:263:18:263:26 | SSA def(s2) | CSharp7.cs:264:45:264:46 | access to local variable s2 | -| CSharp7.cs:263:18:263:26 | String s2 | CSharp7.cs:263:18:263:26 | SSA def(s2) | +| CSharp7.cs:263:25:263:26 | access to local variable s2 | CSharp7.cs:263:18:263:26 | SSA def(s2) | | CSharp7.cs:264:37:264:43 | "string " | CSharp7.cs:264:35:264:48 | $"..." | | CSharp7.cs:264:44:264:47 | {...} | CSharp7.cs:264:35:264:48 | $"..." | | CSharp7.cs:264:45:264:46 | access to local variable s2 | CSharp7.cs:264:44:264:47 | {...} | @@ -329,10 +329,10 @@ | CSharp7.cs:297:25:297:25 | access to local variable x | CSharp7.cs:297:25:297:30 | ... < ... | | CSharp7.cs:297:25:297:25 | access to local variable x | CSharp7.cs:297:35:297:35 | access to local variable x | | CSharp7.cs:297:25:297:30 | ... < ... | CSharp7.cs:297:25:297:44 | ... && ... | -| CSharp7.cs:297:35:297:35 | access to local variable x | CSharp7.cs:297:40:297:44 | Int32 y | +| CSharp7.cs:297:35:297:35 | access to local variable x | CSharp7.cs:297:44:297:44 | access to local variable y | | CSharp7.cs:297:35:297:35 | access to local variable x | CSharp7.cs:297:49:297:49 | access to local variable x | | CSharp7.cs:297:35:297:44 | ... is ... | CSharp7.cs:297:25:297:44 | ... && ... | -| CSharp7.cs:297:40:297:44 | Int32 y | CSharp7.cs:297:40:297:44 | SSA def(y) | | CSharp7.cs:297:40:297:44 | SSA def(y) | CSharp7.cs:299:31:299:31 | access to local variable y | +| CSharp7.cs:297:44:297:44 | access to local variable y | CSharp7.cs:297:40:297:44 | SSA def(y) | | CSharp7.cs:297:47:297:49 | SSA def(x) | CSharp7.cs:297:25:297:25 | access to local variable x | | CSharp7.cs:297:49:297:49 | access to local variable x | CSharp7.cs:297:47:297:49 | SSA def(x) | diff --git a/csharp/ql/test/library-tests/csharp7/PrintAst.expected b/csharp/ql/test/library-tests/csharp7/PrintAst.expected index 6ac8d9d92ac7..45863d2ac65f 100644 --- a/csharp/ql/test/library-tests/csharp7/PrintAst.expected +++ b/csharp/ql/test/library-tests/csharp7/PrintAst.expected @@ -716,7 +716,8 @@ CSharp7.cs: # 233| 0: [IsExpr] ... is ... # 233| 0: [LocalVariableAccess] access to local variable o # 233| 1: [VariablePatternExpr] Int32 i1 -# 233| 0: [TypeMention] int +# 233| -1: [TypeMention] int +# 233| 0: [LocalVariableAccess] access to local variable i1 # 233| 1: [GTExpr] ... > ... # 233| 0: [LocalVariableAccess] access to local variable i1 # 233| 1: [IntLiteral] 0 @@ -733,7 +734,8 @@ CSharp7.cs: # 237| 0: [IsExpr] ... is ... # 237| 0: [LocalVariableAccess] access to local variable o # 237| 1: [VariablePatternExpr] String s1 -# 237| 0: [TypeMention] string +# 237| -1: [TypeMention] string +# 237| 0: [LocalVariableAccess] access to local variable s1 # 238| 1: [BlockStmt] {...} # 239| 0: [ExprStmt] ...; # 239| 0: [MethodCall] call to method WriteLine @@ -753,6 +755,7 @@ CSharp7.cs: # 244| 0: [IsExpr] ... is ... # 244| 0: [LocalVariableAccess] access to local variable o # 244| 1: [VariablePatternExpr] Object v1 +# 244| 0: [LocalVariableAccess] access to local variable v1 # 245| 1: [BlockStmt] {...} # 248| 2: [SwitchStmt] switch (...) {...} # 248| 0: [LocalVariableAccess] access to local variable o @@ -770,7 +773,8 @@ CSharp7.cs: # 254| 1: [IsExpr] ... is ... # 254| 0: [LocalVariableAccess] access to local variable o # 254| 1: [VariablePatternExpr] String s4 -# 254| 0: [TypeMention] string +# 254| -1: [TypeMention] string +# 254| 0: [LocalVariableAccess] access to local variable s4 # 255| 5: [ExprStmt] ...; # 255| 0: [MethodCall] call to method WriteLine # 255| -1: [TypeAccess] access to type Console @@ -782,7 +786,8 @@ CSharp7.cs: # 256| 6: [BreakStmt] break; # 257| 7: [CaseStmt] case ...: # 257| 0: [VariablePatternExpr] Int32 i2 -# 257| 0: [TypeMention] int +# 257| -1: [TypeMention] int +# 257| 0: [LocalVariableAccess] access to local variable i2 # 257| 1: [GTExpr] ... > ... # 257| 0: [LocalVariableAccess] access to local variable i2 # 257| 1: [IntLiteral] 0 @@ -797,7 +802,8 @@ CSharp7.cs: # 259| 9: [BreakStmt] break; # 260| 10: [CaseStmt] case ...: # 260| 0: [VariablePatternExpr] Int32 i3 -# 260| 0: [TypeMention] int +# 260| -1: [TypeMention] int +# 260| 0: [LocalVariableAccess] access to local variable i3 # 261| 11: [ExprStmt] ...; # 261| 0: [MethodCall] call to method WriteLine # 261| -1: [TypeAccess] access to type Console @@ -809,7 +815,8 @@ CSharp7.cs: # 262| 12: [BreakStmt] break; # 263| 13: [CaseStmt] case ...: # 263| 0: [VariablePatternExpr] String s2 -# 263| 0: [TypeMention] string +# 263| -1: [TypeMention] string +# 263| 0: [LocalVariableAccess] access to local variable s2 # 264| 14: [ExprStmt] ...; # 264| 0: [MethodCall] call to method WriteLine # 264| -1: [TypeAccess] access to type Console @@ -830,6 +837,7 @@ CSharp7.cs: # 268| 18: [BreakStmt] break; # 269| 19: [CaseStmt] case ...: # 269| 0: [VariablePatternExpr] Object v2 +# 269| 0: [LocalVariableAccess] access to local variable v2 # 270| 20: [BreakStmt] break; # 271| 21: [DefaultCase] default: # 272| 22: [ExprStmt] ...; @@ -898,7 +906,8 @@ CSharp7.cs: # 297| 1: [IsExpr] ... is ... # 297| 0: [LocalVariableAccess] access to local variable x # 297| 1: [VariablePatternExpr] Int32 y -# 297| 0: [TypeMention] int +# 297| -1: [TypeMention] int +# 297| 0: [LocalVariableAccess] access to local variable y # 297| 1: [PreIncrExpr] ++... # 297| 0: [LocalVariableAccess] access to local variable x # 298| 2: [BlockStmt] {...} diff --git a/csharp/ql/test/library-tests/csharp8/PrintAst.expected b/csharp/ql/test/library-tests/csharp8/PrintAst.expected index b2471d3ca201..b6524a6d15a1 100644 --- a/csharp/ql/test/library-tests/csharp8/PrintAst.expected +++ b/csharp/ql/test/library-tests/csharp8/PrintAst.expected @@ -780,7 +780,8 @@ patterns.cs: # 9| 0: [IsExpr] ... is ... # 9| 0: [LocalVariableAccess] access to local variable o # 9| 1: [VariablePatternExpr] MyStruct ms1 -# 9| 0: [TypeMention] MyStruct +# 9| -1: [TypeMention] MyStruct +# 9| 0: [LocalVariableAccess] access to local variable ms1 # 10| 1: [BlockStmt] {...} # 13| 2: [IfStmt] if (...) ... # 13| 0: [LogicalAndExpr] ... && ... @@ -789,11 +790,13 @@ patterns.cs: # 13| 0: [LocalVariableAccess] access to local variable o # 13| 1: [RecursivePatternExpr] { ... } # 13| 0: [VariablePatternExpr] MyStruct s +# 13| 0: [LocalVariableAccess] access to local variable s # 13| 1: [TypeAccessPatternExpr] access to type MyStruct # 13| 0: [TypeMention] MyStruct # 13| 3: [PropertyPatternExpr] { ... } # 13| 0: [LabeledPatternExpr,VariablePatternExpr] Int32 x -# 13| 0: [TypeMention] int +# 13| -1: [TypeMention] int +# 13| 0: [LocalVariableAccess] access to local variable x # 13| 1: [LTExpr] ... < ... # 13| 0: [LocalVariableAccess] access to local variable x # 13| 1: [IntLiteral] 4 @@ -807,6 +810,7 @@ patterns.cs: # 17| 0: [LocalVariableAccess] access to local variable o # 17| 1: [RecursivePatternExpr] { ... } # 17| 0: [VariablePatternExpr] Object p +# 17| 0: [LocalVariableAccess] access to local variable p # 17| 3: [PropertyPatternExpr] { ... } # 18| 1: [BlockStmt] {...} # 22| 4: [IfStmt] if (...) ... @@ -820,6 +824,7 @@ patterns.cs: # 22| 1: [LabeledPatternExpr,RecursivePatternExpr] { ... } # 22| 3: [PropertyPatternExpr] { ... } # 22| 0: [LabeledPatternExpr,VariablePatternExpr] Int32 subX +# 22| 0: [LocalVariableAccess] access to local variable subX # 23| 1: [BlockStmt] {...} # 27| 5: [IfStmt] if (...) ... # 27| 0: [IsExpr] ... is ... @@ -831,6 +836,7 @@ patterns.cs: # 27| 0: [ConstantPatternExpr,IntLiteral,LabeledPatternExpr] 12 # 27| 1: [LabeledPatternExpr,RecursivePatternExpr] { ... } # 27| 0: [VariablePatternExpr] MyStruct ms +# 27| 0: [LocalVariableAccess] access to local variable ms # 27| 1: [TypeAccessPatternExpr] access to type MyStruct # 27| 0: [TypeMention] MyStruct # 27| 3: [PropertyPatternExpr] { ... } @@ -853,7 +859,8 @@ patterns.cs: # 36| 0: [LocalVariableAccess] access to local variable s # 38| 0: [CaseStmt] case ...: # 38| 0: [VariablePatternExpr] MyStruct ms1 -# 38| 0: [TypeMention] MyStruct +# 38| -1: [TypeMention] MyStruct +# 38| 0: [LocalVariableAccess] access to local variable ms1 # 38| 1: [EQExpr] ... == ... # 38| 0: [FieldAccess] access to field X # 38| -1: [LocalVariableAccess] access to local variable ms1 @@ -866,7 +873,8 @@ patterns.cs: # 40| 2: [BreakStmt] break; # 41| 3: [CaseStmt] case ...: # 41| 0: [VariablePatternExpr] MyStruct ms2 -# 41| 0: [TypeMention] MyStruct +# 41| -1: [TypeMention] MyStruct +# 41| 0: [LocalVariableAccess] access to local variable ms2 # 41| 1: [LTExpr] ... < ... # 41| 0: [FieldAccess] access to field X # 41| -1: [LocalVariableAccess] access to local variable ms2 @@ -885,7 +893,8 @@ patterns.cs: # 48| 0: [TypeMention] MyStruct # 48| 3: [PropertyPatternExpr] { ... } # 48| 0: [LabeledPatternExpr,VariablePatternExpr] Int32 x -# 48| 0: [TypeMention] int +# 48| -1: [TypeMention] int +# 48| 0: [LocalVariableAccess] access to local variable x # 48| 1: [GTExpr] ... > ... # 48| 0: [LocalVariableAccess] access to local variable x # 48| 1: [IntLiteral] 2 @@ -898,6 +907,7 @@ patterns.cs: # 51| 3: [CaseStmt] case ...: # 51| 0: [RecursivePatternExpr] { ... } # 51| 0: [VariablePatternExpr] MyStruct ms +# 51| 0: [LocalVariableAccess] access to local variable ms # 51| 1: [TypeAccessPatternExpr] access to type MyStruct # 51| 0: [TypeMention] MyStruct # 51| 3: [PropertyPatternExpr] { ... } @@ -912,7 +922,8 @@ patterns.cs: # 54| 0: [RecursivePatternExpr] { ... } # 54| 3: [PropertyPatternExpr] { ... } # 54| 0: [LabeledPatternExpr,VariablePatternExpr] Int32 x2 -# 54| 0: [TypeMention] int +# 54| -1: [TypeMention] int +# 54| 0: [LocalVariableAccess] access to local variable x2 # 54| 1: [GTExpr] ... > ... # 54| 0: [LocalVariableAccess] access to local variable x2 # 54| 1: [IntLiteral] 2 @@ -931,7 +942,9 @@ patterns.cs: # 59| 11: [CaseStmt] case ...: # 59| 0: [TuplePatternExpr] (..., ...) # 59| 0: [VariablePatternExpr] Int32 x +# 59| 0: [LocalVariableAccess] access to local variable x # 59| 1: [VariablePatternExpr] Int32 y +# 59| 0: [LocalVariableAccess] access to local variable y # 60| 12: [BreakStmt] break; # 61| 13: [DefaultCase] default: # 62| 14: [BreakStmt] break; @@ -943,7 +956,8 @@ patterns.cs: # 67| 0: [TypeMention] MyStruct # 67| 3: [PropertyPatternExpr] { ... } # 67| 0: [LabeledPatternExpr,VariablePatternExpr] Int32 x -# 67| 0: [TypeMention] int +# 67| -1: [TypeMention] int +# 67| 0: [LocalVariableAccess] access to local variable x # 67| 1: [GTExpr] ... > ... # 67| 0: [LocalVariableAccess] access to local variable x # 67| 1: [IntLiteral] 2 @@ -956,6 +970,7 @@ patterns.cs: # 70| 3: [CaseStmt] case ...: # 70| 0: [RecursivePatternExpr] { ... } # 70| 0: [VariablePatternExpr] MyStruct ms +# 70| 0: [LocalVariableAccess] access to local variable ms # 70| 1: [TypeAccessPatternExpr] access to type MyStruct # 70| 0: [TypeMention] MyStruct # 70| 3: [PropertyPatternExpr] { ... } @@ -977,9 +992,11 @@ patterns.cs: # 78| 0: [RecursivePatternExpr] { ... } # 78| 2: [PositionalPatternExpr] ( ... ) # 78| 0: [VariablePatternExpr] Int32 x -# 78| 0: [TypeMention] int +# 78| -1: [TypeMention] int +# 78| 0: [LocalVariableAccess] access to local variable x # 78| 1: [VariablePatternExpr] Single y -# 78| 0: [TypeMention] float +# 78| -1: [TypeMention] float +# 78| 0: [LocalVariableAccess] access to local variable y # 78| 1: [LTExpr] ... < ... # 78| 0: [CastExpr] (...) ... # 78| 1: [LocalVariableAccess] access to local variable x @@ -1012,6 +1029,7 @@ patterns.cs: # 93| 2: [PositionalPatternExpr] ( ... ) # 93| 0: [ConstantPatternExpr,IntLiteral] 1 # 93| 1: [VariablePatternExpr] Int32 x +# 93| 0: [LocalVariableAccess] access to local variable x # 93| 1: [BreakStmt] break; # 94| 2: [CaseStmt] case ...: # 94| 0: [RecursivePatternExpr] { ... } @@ -1033,7 +1051,8 @@ patterns.cs: # 100| -1: [ParameterAccess] access to parameter x # 101| 0: [SwitchCaseExpr] ... => ... # 101| 0: [VariablePatternExpr] Int32 y -# 101| 0: [TypeMention] int +# 101| -1: [TypeMention] int +# 101| 0: [LocalVariableAccess] access to local variable y # 101| 1: [GTExpr] ... > ... # 101| 0: [LocalVariableAccess] access to local variable y # 101| 1: [IntLiteral] 10 @@ -1089,6 +1108,7 @@ patterns.cs: # 117| 2: [PositionalPatternExpr] ( ... ) # 117| 0: [ConstantPatternExpr,IntLiteral] 0 # 117| 1: [VariablePatternExpr] Int32 y2 +# 117| 0: [LocalVariableAccess] access to local variable y2 # 117| 2: [TupleExpr] (..., ...) # 117| 0: [LocalVariableAccess] access to local variable y2 # 117| 1: [IntLiteral] 0 @@ -1096,6 +1116,7 @@ patterns.cs: # 118| 0: [RecursivePatternExpr] { ... } # 118| 2: [PositionalPatternExpr] ( ... ) # 118| 0: [VariablePatternExpr] Int32 x2 +# 118| 0: [LocalVariableAccess] access to local variable x2 # 118| 1: [ConstantPatternExpr,IntLiteral] 0 # 118| 2: [TupleExpr] (..., ...) # 118| 0: [IntLiteral] 0 @@ -1104,7 +1125,9 @@ patterns.cs: # 119| 0: [RecursivePatternExpr] { ... } # 119| 2: [PositionalPatternExpr] ( ... ) # 119| 0: [VariablePatternExpr] Int32 x2 +# 119| 0: [LocalVariableAccess] access to local variable x2 # 119| 1: [VariablePatternExpr] Int32 y2 +# 119| 0: [LocalVariableAccess] access to local variable y2 # 119| 2: [TupleExpr] (..., ...) # 119| 0: [IntLiteral] 0 # 119| 1: [IntLiteral] 0 @@ -1136,7 +1159,8 @@ patterns.cs: # 128| 0: [TypeMention] MyStruct # 128| 3: [PropertyPatternExpr] { ... } # 128| 0: [LabeledPatternExpr,VariablePatternExpr] Int32 x -# 128| 0: [TypeMention] int +# 128| -1: [TypeMention] int +# 128| 0: [LocalVariableAccess] access to local variable x # 128| 1: [GTExpr] ... > ... # 128| 0: [LocalVariableAccess] access to local variable x # 128| 1: [IntLiteral] 2 @@ -1144,6 +1168,7 @@ patterns.cs: # 129| 1: [SwitchCaseExpr] ... => ... # 129| 0: [RecursivePatternExpr] { ... } # 129| 0: [VariablePatternExpr] MyStruct ms +# 129| 0: [LocalVariableAccess] access to local variable ms # 129| 1: [TypeAccessPatternExpr] access to type MyStruct # 129| 0: [TypeMention] MyStruct # 129| 3: [PropertyPatternExpr] { ... } @@ -1158,6 +1183,7 @@ patterns.cs: # 131| 3: [SwitchCaseExpr] ... => ... # 131| 0: [TuplePatternExpr] (..., ...) # 131| 0: [VariablePatternExpr] Int32 x +# 131| 0: [LocalVariableAccess] access to local variable x # 131| 1: [DiscardPatternExpr] _ # 131| 2: [IntLiteral] 3 # 134| 2: [TryStmt] try {...} ... @@ -1177,7 +1203,8 @@ patterns.cs: # 139| 2: [IntLiteral] 3 # 140| 2: [SwitchCaseExpr] ... => ... # 140| 0: [VariablePatternExpr] Object y -# 140| 0: [TypeMention] object +# 140| -1: [TypeMention] object +# 140| 0: [LocalVariableAccess] access to local variable y # 140| 1: [IsExpr] ... is ... # 140| 0: [LocalVariableAccess] access to local variable y # 140| 1: [RecursivePatternExpr] { ... } diff --git a/csharp/ql/test/library-tests/csharp8/ispatternflow.expected b/csharp/ql/test/library-tests/csharp8/ispatternflow.expected index b64779405019..190561c17c18 100644 --- a/csharp/ql/test/library-tests/csharp8/ispatternflow.expected +++ b/csharp/ql/test/library-tests/csharp8/ispatternflow.expected @@ -30,8 +30,11 @@ | patterns.cs:9:13:9:29 | After ... is ... [false] | patterns.cs:9:9:11:9 | After if (...) ... | semmle.label | successor | | patterns.cs:9:13:9:29 | After ... is ... [true] | patterns.cs:10:9:11:9 | {...} | semmle.label | successor | | patterns.cs:9:13:9:29 | Before ... is ... | patterns.cs:9:13:9:13 | access to local variable o | semmle.label | successor | -| patterns.cs:9:13:9:29 | [MatchTrue] ... is ... | patterns.cs:9:18:9:29 | MyStruct ms1 | semmle.label | successor | -| patterns.cs:9:18:9:29 | MyStruct ms1 | patterns.cs:9:13:9:29 | After ... is ... [true] | semmle.label | true | +| patterns.cs:9:13:9:29 | [MatchTrue] ... is ... | patterns.cs:9:18:9:29 | Before MyStruct ms1 | semmle.label | successor | +| patterns.cs:9:18:9:29 | After MyStruct ms1 | patterns.cs:9:13:9:29 | After ... is ... [true] | semmle.label | true | +| patterns.cs:9:18:9:29 | Before MyStruct ms1 | patterns.cs:9:27:9:29 | access to local variable ms1 | semmle.label | successor | +| patterns.cs:9:18:9:29 | MyStruct ms1 | patterns.cs:9:18:9:29 | After MyStruct ms1 | semmle.label | successor | +| patterns.cs:9:27:9:29 | access to local variable ms1 | patterns.cs:9:18:9:29 | MyStruct ms1 | semmle.label | successor | | patterns.cs:10:9:11:9 | {...} | patterns.cs:9:9:11:9 | After if (...) ... | semmle.label | successor | | patterns.cs:13:9:15:9 | After if (...) ... | patterns.cs:17:9:19:9 | if (...) ... | semmle.label | successor | | patterns.cs:13:9:15:9 | if (...) ... | patterns.cs:13:13:13:56 | ... && ... | semmle.label | successor | @@ -49,14 +52,20 @@ | patterns.cs:13:13:13:56 | After ... && ... [false] | patterns.cs:13:9:15:9 | After if (...) ... | semmle.label | successor | | patterns.cs:13:13:13:56 | After ... && ... [true] | patterns.cs:14:9:15:9 | {...} | semmle.label | successor | | patterns.cs:13:18:13:25 | access to type MyStruct | patterns.cs:13:27:13:38 | Before { ... } | semmle.label | successor | +| patterns.cs:13:18:13:40 | After MyStruct s | patterns.cs:13:18:13:25 | access to type MyStruct | semmle.label | successor | | patterns.cs:13:18:13:40 | After { ... } | patterns.cs:13:13:13:40 | After ... is ... [true] | semmle.label | true | -| patterns.cs:13:18:13:40 | Before { ... } | patterns.cs:13:18:13:40 | MyStruct s | semmle.label | successor | -| patterns.cs:13:18:13:40 | MyStruct s | patterns.cs:13:18:13:25 | access to type MyStruct | semmle.label | successor | +| patterns.cs:13:18:13:40 | Before MyStruct s | patterns.cs:13:40:13:40 | access to local variable s | semmle.label | successor | +| patterns.cs:13:18:13:40 | Before { ... } | patterns.cs:13:18:13:40 | Before MyStruct s | semmle.label | successor | +| patterns.cs:13:18:13:40 | MyStruct s | patterns.cs:13:18:13:40 | After MyStruct s | semmle.label | successor | | patterns.cs:13:18:13:40 | { ... } | patterns.cs:13:18:13:40 | After { ... } | semmle.label | successor | | patterns.cs:13:27:13:38 | After { ... } | patterns.cs:13:18:13:40 | { ... } | semmle.label | successor | -| patterns.cs:13:27:13:38 | Before { ... } | patterns.cs:13:32:13:36 | Int32 x | semmle.label | successor | +| patterns.cs:13:27:13:38 | Before { ... } | patterns.cs:13:32:13:36 | Before Int32 x | semmle.label | successor | | patterns.cs:13:27:13:38 | { ... } | patterns.cs:13:27:13:38 | After { ... } | semmle.label | successor | -| patterns.cs:13:32:13:36 | Int32 x | patterns.cs:13:27:13:38 | { ... } | semmle.label | successor | +| patterns.cs:13:32:13:36 | After Int32 x | patterns.cs:13:27:13:38 | { ... } | semmle.label | successor | +| patterns.cs:13:32:13:36 | Before Int32 x | patterns.cs:13:36:13:36 | access to local variable x | semmle.label | successor | +| patterns.cs:13:32:13:36 | Int32 x | patterns.cs:13:32:13:36 | After Int32 x | semmle.label | successor | +| patterns.cs:13:36:13:36 | access to local variable x | patterns.cs:13:32:13:36 | Int32 x | semmle.label | successor | +| patterns.cs:13:40:13:40 | access to local variable s | patterns.cs:13:18:13:40 | MyStruct s | semmle.label | successor | | patterns.cs:13:45:13:45 | access to local variable x | patterns.cs:13:47:13:47 | 4 | semmle.label | successor | | patterns.cs:13:45:13:47 | ... < ... | patterns.cs:13:45:13:47 | After ... < ... [false] | semmle.label | false | | patterns.cs:13:45:13:47 | ... < ... | patterns.cs:13:45:13:47 | After ... < ... [true] | semmle.label | true | @@ -85,10 +94,13 @@ | patterns.cs:17:13:17:21 | Before ... is ... | patterns.cs:17:13:17:13 | access to local variable o | semmle.label | successor | | patterns.cs:17:13:17:21 | [MatchTrue] ... is ... | patterns.cs:17:18:17:21 | Before { ... } | semmle.label | successor | | patterns.cs:17:18:17:19 | { ... } | patterns.cs:17:18:17:21 | { ... } | semmle.label | successor | +| patterns.cs:17:18:17:21 | After Object p | patterns.cs:17:18:17:19 | { ... } | semmle.label | successor | | patterns.cs:17:18:17:21 | After { ... } | patterns.cs:17:13:17:21 | After ... is ... [true] | semmle.label | true | -| patterns.cs:17:18:17:21 | Before { ... } | patterns.cs:17:18:17:21 | Object p | semmle.label | successor | -| patterns.cs:17:18:17:21 | Object p | patterns.cs:17:18:17:19 | { ... } | semmle.label | successor | +| patterns.cs:17:18:17:21 | Before Object p | patterns.cs:17:21:17:21 | access to local variable p | semmle.label | successor | +| patterns.cs:17:18:17:21 | Before { ... } | patterns.cs:17:18:17:21 | Before Object p | semmle.label | successor | +| patterns.cs:17:18:17:21 | Object p | patterns.cs:17:18:17:21 | After Object p | semmle.label | successor | | patterns.cs:17:18:17:21 | { ... } | patterns.cs:17:18:17:21 | After { ... } | semmle.label | successor | +| patterns.cs:17:21:17:21 | access to local variable p | patterns.cs:17:18:17:21 | Object p | semmle.label | successor | | patterns.cs:18:9:19:9 | {...} | patterns.cs:17:9:19:9 | After if (...) ... | semmle.label | successor | | patterns.cs:22:9:24:9 | After if (...) ... | patterns.cs:27:9:29:9 | if (...) ... | semmle.label | successor | | patterns.cs:22:9:24:9 | if (...) ... | patterns.cs:22:13:22:53 | Before ... is ... | semmle.label | successor | @@ -110,10 +122,13 @@ | patterns.cs:22:38:22:51 | After { ... } | patterns.cs:22:27:22:53 | { ... } | semmle.label | successor | | patterns.cs:22:38:22:51 | After { ... } | patterns.cs:22:38:22:51 | { ... } | semmle.label | successor | | patterns.cs:22:38:22:51 | Before { ... } | patterns.cs:22:38:22:51 | Before { ... } | semmle.label | successor | -| patterns.cs:22:38:22:51 | Before { ... } | patterns.cs:22:42:22:49 | Int32 subX | semmle.label | successor | +| patterns.cs:22:38:22:51 | Before { ... } | patterns.cs:22:42:22:49 | Before Int32 subX | semmle.label | successor | | patterns.cs:22:38:22:51 | { ... } | patterns.cs:22:38:22:51 | After { ... } | semmle.label | successor | | patterns.cs:22:38:22:51 | { ... } | patterns.cs:22:38:22:51 | After { ... } | semmle.label | successor | -| patterns.cs:22:42:22:49 | Int32 subX | patterns.cs:22:38:22:51 | { ... } | semmle.label | successor | +| patterns.cs:22:42:22:49 | After Int32 subX | patterns.cs:22:38:22:51 | { ... } | semmle.label | successor | +| patterns.cs:22:42:22:49 | Before Int32 subX | patterns.cs:22:46:22:49 | access to local variable subX | semmle.label | successor | +| patterns.cs:22:42:22:49 | Int32 subX | patterns.cs:22:42:22:49 | After Int32 subX | semmle.label | successor | +| patterns.cs:22:46:22:49 | access to local variable subX | patterns.cs:22:42:22:49 | Int32 subX | semmle.label | successor | | patterns.cs:23:9:24:9 | {...} | patterns.cs:22:9:24:9 | After if (...) ... | semmle.label | successor | | patterns.cs:27:9:29:9 | After if (...) ... | patterns.cs:6:5:30:5 | After {...} | semmle.label | successor | | patterns.cs:27:9:29:9 | if (...) ... | patterns.cs:27:13:27:58 | Before ... is ... | semmle.label | successor | @@ -133,12 +148,15 @@ | patterns.cs:27:27:27:58 | { ... } | patterns.cs:27:27:27:58 | After { ... } | semmle.label | successor | | patterns.cs:27:31:27:32 | 12 | patterns.cs:27:38:27:56 | Before { ... } | semmle.label | successor | | patterns.cs:27:38:27:45 | access to type MyStruct | patterns.cs:27:47:27:53 | Before { ... } | semmle.label | successor | +| patterns.cs:27:38:27:56 | After MyStruct ms | patterns.cs:27:38:27:45 | access to type MyStruct | semmle.label | successor | | patterns.cs:27:38:27:56 | After { ... } | patterns.cs:27:27:27:58 | { ... } | semmle.label | successor | -| patterns.cs:27:38:27:56 | Before { ... } | patterns.cs:27:38:27:56 | MyStruct ms | semmle.label | successor | -| patterns.cs:27:38:27:56 | MyStruct ms | patterns.cs:27:38:27:45 | access to type MyStruct | semmle.label | successor | +| patterns.cs:27:38:27:56 | Before MyStruct ms | patterns.cs:27:55:27:56 | access to local variable ms | semmle.label | successor | +| patterns.cs:27:38:27:56 | Before { ... } | patterns.cs:27:38:27:56 | Before MyStruct ms | semmle.label | successor | +| patterns.cs:27:38:27:56 | MyStruct ms | patterns.cs:27:38:27:56 | After MyStruct ms | semmle.label | successor | | patterns.cs:27:38:27:56 | { ... } | patterns.cs:27:38:27:56 | After { ... } | semmle.label | successor | | patterns.cs:27:47:27:53 | After { ... } | patterns.cs:27:38:27:56 | { ... } | semmle.label | successor | | patterns.cs:27:47:27:53 | Before { ... } | patterns.cs:27:51:27:51 | _ | semmle.label | successor | | patterns.cs:27:47:27:53 | { ... } | patterns.cs:27:47:27:53 | After { ... } | semmle.label | successor | | patterns.cs:27:51:27:51 | _ | patterns.cs:27:47:27:53 | { ... } | semmle.label | successor | +| patterns.cs:27:55:27:56 | access to local variable ms | patterns.cs:27:38:27:56 | MyStruct ms | semmle.label | successor | | patterns.cs:28:9:29:9 | {...} | patterns.cs:27:9:29:9 | After if (...) ... | semmle.label | successor | diff --git a/csharp/ql/test/library-tests/csharp8/patterns.expected b/csharp/ql/test/library-tests/csharp8/patterns.expected index fbfba8a6a825..20761c31bfeb 100644 --- a/csharp/ql/test/library-tests/csharp8/patterns.expected +++ b/csharp/ql/test/library-tests/csharp8/patterns.expected @@ -325,3 +325,31 @@ patternExprTypes | patterns.cs:142:17:142:36 | { ... } | MyStruct | | patterns.cs:142:26:142:34 | { ... } | null | | patterns.cs:142:31:142:32 | 10 | Int32 | +patternDefiningAccess +| patterns.cs:9:18:9:29 | MyStruct ms1 | patterns.cs:9:27:9:29 | access to local variable ms1 | patterns.cs:9:27:9:29 | ms1 | +| patterns.cs:13:18:13:40 | MyStruct s | patterns.cs:13:40:13:40 | access to local variable s | patterns.cs:13:40:13:40 | s | +| patterns.cs:13:32:13:36 | Int32 x | patterns.cs:13:36:13:36 | access to local variable x | patterns.cs:13:36:13:36 | x | +| patterns.cs:17:18:17:21 | Object p | patterns.cs:17:21:17:21 | access to local variable p | patterns.cs:17:21:17:21 | p | +| patterns.cs:22:42:22:49 | Int32 subX | patterns.cs:22:46:22:49 | access to local variable subX | patterns.cs:22:46:22:49 | subX | +| patterns.cs:27:38:27:56 | MyStruct ms | patterns.cs:27:55:27:56 | access to local variable ms | patterns.cs:27:55:27:56 | ms | +| patterns.cs:38:18:38:29 | MyStruct ms1 | patterns.cs:38:27:38:29 | access to local variable ms1 | patterns.cs:38:27:38:29 | ms1 | +| patterns.cs:41:18:41:29 | MyStruct ms2 | patterns.cs:41:27:41:29 | access to local variable ms2 | patterns.cs:41:27:41:29 | ms2 | +| patterns.cs:48:32:48:36 | Int32 x | patterns.cs:48:36:48:36 | access to local variable x | patterns.cs:48:36:48:36 | x | +| patterns.cs:51:18:51:38 | MyStruct ms | patterns.cs:51:37:51:38 | access to local variable ms | patterns.cs:51:37:51:38 | ms | +| patterns.cs:54:23:54:28 | Int32 x2 | patterns.cs:54:27:54:28 | access to local variable x2 | patterns.cs:54:27:54:28 | x2 | +| patterns.cs:59:23:59:23 | Int32 x | patterns.cs:59:23:59:23 | access to local variable x | patterns.cs:59:23:59:23 | x | +| patterns.cs:59:26:59:26 | Int32 y | patterns.cs:59:26:59:26 | access to local variable y | patterns.cs:59:26:59:26 | y | +| patterns.cs:67:32:67:36 | Int32 x | patterns.cs:67:36:67:36 | access to local variable x | patterns.cs:67:36:67:36 | x | +| patterns.cs:70:18:70:38 | MyStruct ms | patterns.cs:70:37:70:38 | access to local variable ms | patterns.cs:70:37:70:38 | ms | +| patterns.cs:78:19:78:23 | Int32 x | patterns.cs:78:23:78:23 | access to local variable x | patterns.cs:78:23:78:23 | x | +| patterns.cs:78:26:78:32 | Single y | patterns.cs:78:32:78:32 | access to local variable y | patterns.cs:78:32:78:32 | y | +| patterns.cs:93:22:93:26 | Int32 x | patterns.cs:93:26:93:26 | access to local variable x | patterns.cs:93:26:93:26 | x | +| patterns.cs:101:13:101:17 | Int32 y | patterns.cs:101:17:101:17 | access to local variable y | patterns.cs:101:17:101:17 | y | +| patterns.cs:117:16:117:21 | Int32 y2 | patterns.cs:117:20:117:21 | access to local variable y2 | patterns.cs:117:20:117:21 | y2 | +| patterns.cs:118:14:118:19 | Int32 x2 | patterns.cs:118:18:118:19 | access to local variable x2 | patterns.cs:118:18:118:19 | x2 | +| patterns.cs:119:14:119:19 | Int32 x2 | patterns.cs:119:18:119:19 | access to local variable x2 | patterns.cs:119:18:119:19 | x2 | +| patterns.cs:119:22:119:27 | Int32 y2 | patterns.cs:119:26:119:27 | access to local variable y2 | patterns.cs:119:26:119:27 | y2 | +| patterns.cs:128:27:128:31 | Int32 x | patterns.cs:128:31:128:31 | access to local variable x | patterns.cs:128:31:128:31 | x | +| patterns.cs:129:13:129:33 | MyStruct ms | patterns.cs:129:32:129:33 | access to local variable ms | patterns.cs:129:32:129:33 | ms | +| patterns.cs:131:18:131:18 | Int32 x | patterns.cs:131:18:131:18 | access to local variable x | patterns.cs:131:18:131:18 | x | +| patterns.cs:140:17:140:24 | Object y | patterns.cs:140:24:140:24 | access to local variable y | patterns.cs:140:24:140:24 | y | diff --git a/csharp/ql/test/library-tests/csharp8/patterns.ql b/csharp/ql/test/library-tests/csharp8/patterns.ql index 164eea21e09a..aeaf06733836 100644 --- a/csharp/ql/test/library-tests/csharp8/patterns.ql +++ b/csharp/ql/test/library-tests/csharp8/patterns.ql @@ -73,3 +73,13 @@ query predicate tupleTypes(TupleExpr te, string type) { te.getType().toString() query predicate patternExprTypes(PatternExpr pattern, string type) { pattern.getType().toString() = type } + +query predicate patternDefiningAccess( + LocalVariableDeclExpr decl, AssignableWrite access, LocalVariable target +) { + decl = any(AssignableDefinitions::PatternDefinition def).getDeclaration() and + access = decl.getAccess() and + target = decl.getVariable() and + target = access.getTarget() and + not access instanceof AssignableRead +} diff --git a/csharp/ql/test/library-tests/csharp8/switchexprcontrolflow.expected b/csharp/ql/test/library-tests/csharp8/switchexprcontrolflow.expected index 5eacd99b7e6f..c846c7679e52 100644 --- a/csharp/ql/test/library-tests/csharp8/switchexprcontrolflow.expected +++ b/csharp/ql/test/library-tests/csharp8/switchexprcontrolflow.expected @@ -14,11 +14,13 @@ | patterns.cs:100:20:103:9 | After ... switch { ... } | patterns.cs:100:13:103:9 | String size = ... | semmle.label | successor | | patterns.cs:101:13:101:17 | After Int32 y [match] | patterns.cs:101:13:101:40 | After ... => ... [match] | semmle.label | match | | patterns.cs:101:13:101:17 | After Int32 y [no-match] | patterns.cs:101:13:101:40 | After ... => ... [no-match] | semmle.label | no-match | +| patterns.cs:101:13:101:17 | Before Int32 y | patterns.cs:101:17:101:17 | access to local variable y | semmle.label | successor | | patterns.cs:101:13:101:17 | Int32 y | patterns.cs:101:13:101:17 | After Int32 y [match] | semmle.label | match | | patterns.cs:101:13:101:17 | Int32 y | patterns.cs:101:13:101:17 | After Int32 y [no-match] | semmle.label | no-match | -| patterns.cs:101:13:101:40 | ... => ... | patterns.cs:101:13:101:17 | Int32 y | semmle.label | successor | +| patterns.cs:101:13:101:40 | ... => ... | patterns.cs:101:13:101:17 | Before Int32 y | semmle.label | successor | | patterns.cs:101:13:101:40 | After ... => ... [match] | patterns.cs:101:24:101:29 | Before ... > ... | semmle.label | successor | | patterns.cs:101:13:101:40 | After ... => ... [no-match] | patterns.cs:102:13:102:24 | ... => ... | semmle.label | successor | +| patterns.cs:101:17:101:17 | access to local variable y | patterns.cs:101:13:101:17 | Int32 y | semmle.label | successor | | patterns.cs:101:24:101:24 | access to local variable y | patterns.cs:101:28:101:29 | 10 | semmle.label | successor | | patterns.cs:101:24:101:29 | ... > ... | patterns.cs:101:24:101:29 | After ... > ... [false] | semmle.label | false | | patterns.cs:101:24:101:29 | ... > ... | patterns.cs:101:24:101:29 | After ... > ... [true] | semmle.label | true | @@ -125,8 +127,11 @@ | patterns.cs:117:13:117:33 | ... => ... | patterns.cs:117:13:117:22 | Before { ... } | semmle.label | successor | | patterns.cs:117:13:117:33 | After ... => ... [match] | patterns.cs:117:27:117:33 | Before (..., ...) | semmle.label | successor | | patterns.cs:117:13:117:33 | After ... => ... [no-match] | patterns.cs:118:13:118:34 | ... => ... | semmle.label | successor | -| patterns.cs:117:14:117:14 | 0 | patterns.cs:117:16:117:21 | Int32 y2 | semmle.label | successor | -| patterns.cs:117:16:117:21 | Int32 y2 | patterns.cs:117:13:117:22 | ( ... ) | semmle.label | successor | +| patterns.cs:117:14:117:14 | 0 | patterns.cs:117:16:117:21 | Before Int32 y2 | semmle.label | successor | +| patterns.cs:117:16:117:21 | After Int32 y2 | patterns.cs:117:13:117:22 | ( ... ) | semmle.label | successor | +| patterns.cs:117:16:117:21 | Before Int32 y2 | patterns.cs:117:20:117:21 | access to local variable y2 | semmle.label | successor | +| patterns.cs:117:16:117:21 | Int32 y2 | patterns.cs:117:16:117:21 | After Int32 y2 | semmle.label | successor | +| patterns.cs:117:20:117:21 | access to local variable y2 | patterns.cs:117:16:117:21 | Int32 y2 | semmle.label | successor | | patterns.cs:117:27:117:33 | (..., ...) | patterns.cs:117:27:117:33 | After (..., ...) | semmle.label | successor | | patterns.cs:117:27:117:33 | After (..., ...) | patterns.cs:115:20:120:9 | After ... switch { ... } | semmle.label | successor | | patterns.cs:117:27:117:33 | Before (..., ...) | patterns.cs:117:28:117:29 | access to local variable y2 | semmle.label | successor | @@ -136,14 +141,17 @@ | patterns.cs:118:13:118:23 | After ( ... ) | patterns.cs:118:13:118:23 | { ... } | semmle.label | successor | | patterns.cs:118:13:118:23 | After { ... } [match] | patterns.cs:118:13:118:34 | After ... => ... [match] | semmle.label | match | | patterns.cs:118:13:118:23 | After { ... } [no-match] | patterns.cs:118:13:118:34 | After ... => ... [no-match] | semmle.label | no-match | -| patterns.cs:118:13:118:23 | Before ( ... ) | patterns.cs:118:14:118:19 | Int32 x2 | semmle.label | successor | +| patterns.cs:118:13:118:23 | Before ( ... ) | patterns.cs:118:14:118:19 | Before Int32 x2 | semmle.label | successor | | patterns.cs:118:13:118:23 | Before { ... } | patterns.cs:118:13:118:23 | Before ( ... ) | semmle.label | successor | | patterns.cs:118:13:118:23 | { ... } | patterns.cs:118:13:118:23 | After { ... } [match] | semmle.label | match | | patterns.cs:118:13:118:23 | { ... } | patterns.cs:118:13:118:23 | After { ... } [no-match] | semmle.label | no-match | | patterns.cs:118:13:118:34 | ... => ... | patterns.cs:118:13:118:23 | Before { ... } | semmle.label | successor | | patterns.cs:118:13:118:34 | After ... => ... [match] | patterns.cs:118:28:118:34 | Before (..., ...) | semmle.label | successor | | patterns.cs:118:13:118:34 | After ... => ... [no-match] | patterns.cs:119:13:119:38 | ... => ... | semmle.label | successor | -| patterns.cs:118:14:118:19 | Int32 x2 | patterns.cs:118:22:118:22 | 0 | semmle.label | successor | +| patterns.cs:118:14:118:19 | After Int32 x2 | patterns.cs:118:22:118:22 | 0 | semmle.label | successor | +| patterns.cs:118:14:118:19 | Before Int32 x2 | patterns.cs:118:18:118:19 | access to local variable x2 | semmle.label | successor | +| patterns.cs:118:14:118:19 | Int32 x2 | patterns.cs:118:14:118:19 | After Int32 x2 | semmle.label | successor | +| patterns.cs:118:18:118:19 | access to local variable x2 | patterns.cs:118:14:118:19 | Int32 x2 | semmle.label | successor | | patterns.cs:118:22:118:22 | 0 | patterns.cs:118:13:118:23 | ( ... ) | semmle.label | successor | | patterns.cs:118:28:118:34 | (..., ...) | patterns.cs:118:28:118:34 | After (..., ...) | semmle.label | successor | | patterns.cs:118:28:118:34 | After (..., ...) | patterns.cs:115:20:120:9 | After ... switch { ... } | semmle.label | successor | @@ -154,15 +162,21 @@ | patterns.cs:119:13:119:28 | After ( ... ) | patterns.cs:119:13:119:28 | { ... } | semmle.label | successor | | patterns.cs:119:13:119:28 | After { ... } [match] | patterns.cs:119:13:119:38 | After ... => ... [match] | semmle.label | match | | patterns.cs:119:13:119:28 | After { ... } [no-match] | patterns.cs:119:13:119:38 | After ... => ... [no-match] | semmle.label | no-match | -| patterns.cs:119:13:119:28 | Before ( ... ) | patterns.cs:119:14:119:19 | Int32 x2 | semmle.label | successor | +| patterns.cs:119:13:119:28 | Before ( ... ) | patterns.cs:119:14:119:19 | Before Int32 x2 | semmle.label | successor | | patterns.cs:119:13:119:28 | Before { ... } | patterns.cs:119:13:119:28 | Before ( ... ) | semmle.label | successor | | patterns.cs:119:13:119:28 | { ... } | patterns.cs:119:13:119:28 | After { ... } [match] | semmle.label | match | | patterns.cs:119:13:119:28 | { ... } | patterns.cs:119:13:119:28 | After { ... } [no-match] | semmle.label | no-match | | patterns.cs:119:13:119:38 | ... => ... | patterns.cs:119:13:119:28 | Before { ... } | semmle.label | successor | | patterns.cs:119:13:119:38 | After ... => ... [match] | patterns.cs:119:33:119:38 | Before (..., ...) | semmle.label | successor | | patterns.cs:119:13:119:38 | After ... => ... [no-match] | patterns.cs:115:20:120:9 | After ... switch { ... } | semmle.label | successor | -| patterns.cs:119:14:119:19 | Int32 x2 | patterns.cs:119:22:119:27 | Int32 y2 | semmle.label | successor | -| patterns.cs:119:22:119:27 | Int32 y2 | patterns.cs:119:13:119:28 | ( ... ) | semmle.label | successor | +| patterns.cs:119:14:119:19 | After Int32 x2 | patterns.cs:119:22:119:27 | Before Int32 y2 | semmle.label | successor | +| patterns.cs:119:14:119:19 | Before Int32 x2 | patterns.cs:119:18:119:19 | access to local variable x2 | semmle.label | successor | +| patterns.cs:119:14:119:19 | Int32 x2 | patterns.cs:119:14:119:19 | After Int32 x2 | semmle.label | successor | +| patterns.cs:119:18:119:19 | access to local variable x2 | patterns.cs:119:14:119:19 | Int32 x2 | semmle.label | successor | +| patterns.cs:119:22:119:27 | After Int32 y2 | patterns.cs:119:13:119:28 | ( ... ) | semmle.label | successor | +| patterns.cs:119:22:119:27 | Before Int32 y2 | patterns.cs:119:26:119:27 | access to local variable y2 | semmle.label | successor | +| patterns.cs:119:22:119:27 | Int32 y2 | patterns.cs:119:22:119:27 | After Int32 y2 | semmle.label | successor | +| patterns.cs:119:26:119:27 | access to local variable y2 | patterns.cs:119:22:119:27 | Int32 y2 | semmle.label | successor | | patterns.cs:119:33:119:38 | (..., ...) | patterns.cs:119:33:119:38 | After (..., ...) | semmle.label | successor | | patterns.cs:119:33:119:38 | After (..., ...) | patterns.cs:115:20:120:9 | After ... switch { ... } | semmle.label | successor | | patterns.cs:119:33:119:38 | Before (..., ...) | patterns.cs:119:34:119:34 | 0 | semmle.label | successor | @@ -210,9 +224,12 @@ | patterns.cs:128:13:128:49 | After ... => ... [match] | patterns.cs:128:40:128:44 | Before ... > ... | semmle.label | successor | | patterns.cs:128:13:128:49 | After ... => ... [no-match] | patterns.cs:129:13:129:38 | ... => ... | semmle.label | successor | | patterns.cs:128:22:128:33 | After { ... } | patterns.cs:128:13:128:33 | { ... } | semmle.label | successor | -| patterns.cs:128:22:128:33 | Before { ... } | patterns.cs:128:27:128:31 | Int32 x | semmle.label | successor | +| patterns.cs:128:22:128:33 | Before { ... } | patterns.cs:128:27:128:31 | Before Int32 x | semmle.label | successor | | patterns.cs:128:22:128:33 | { ... } | patterns.cs:128:22:128:33 | After { ... } | semmle.label | successor | -| patterns.cs:128:27:128:31 | Int32 x | patterns.cs:128:22:128:33 | { ... } | semmle.label | successor | +| patterns.cs:128:27:128:31 | After Int32 x | patterns.cs:128:22:128:33 | { ... } | semmle.label | successor | +| patterns.cs:128:27:128:31 | Before Int32 x | patterns.cs:128:31:128:31 | access to local variable x | semmle.label | successor | +| patterns.cs:128:27:128:31 | Int32 x | patterns.cs:128:27:128:31 | After Int32 x | semmle.label | successor | +| patterns.cs:128:31:128:31 | access to local variable x | patterns.cs:128:27:128:31 | Int32 x | semmle.label | successor | | patterns.cs:128:40:128:40 | access to local variable x | patterns.cs:128:44:128:44 | 2 | semmle.label | successor | | patterns.cs:128:40:128:44 | ... > ... | patterns.cs:128:40:128:44 | After ... > ... [false] | semmle.label | false | | patterns.cs:128:40:128:44 | ... > ... | patterns.cs:128:40:128:44 | After ... > ... [true] | semmle.label | true | @@ -222,10 +239,12 @@ | patterns.cs:128:44:128:44 | 2 | patterns.cs:128:40:128:44 | ... > ... | semmle.label | successor | | patterns.cs:128:49:128:49 | 0 | patterns.cs:126:17:132:9 | After ... switch { ... } | semmle.label | successor | | patterns.cs:129:13:129:20 | access to type MyStruct | patterns.cs:129:22:129:30 | Before { ... } | semmle.label | successor | +| patterns.cs:129:13:129:33 | After MyStruct ms | patterns.cs:129:13:129:20 | access to type MyStruct | semmle.label | successor | | patterns.cs:129:13:129:33 | After { ... } [match] | patterns.cs:129:13:129:38 | After ... => ... [match] | semmle.label | match | | patterns.cs:129:13:129:33 | After { ... } [no-match] | patterns.cs:129:13:129:38 | After ... => ... [no-match] | semmle.label | no-match | -| patterns.cs:129:13:129:33 | Before { ... } | patterns.cs:129:13:129:33 | MyStruct ms | semmle.label | successor | -| patterns.cs:129:13:129:33 | MyStruct ms | patterns.cs:129:13:129:20 | access to type MyStruct | semmle.label | successor | +| patterns.cs:129:13:129:33 | Before MyStruct ms | patterns.cs:129:32:129:33 | access to local variable ms | semmle.label | successor | +| patterns.cs:129:13:129:33 | Before { ... } | patterns.cs:129:13:129:33 | Before MyStruct ms | semmle.label | successor | +| patterns.cs:129:13:129:33 | MyStruct ms | patterns.cs:129:13:129:33 | After MyStruct ms | semmle.label | successor | | patterns.cs:129:13:129:33 | { ... } | patterns.cs:129:13:129:33 | After { ... } [match] | semmle.label | match | | patterns.cs:129:13:129:33 | { ... } | patterns.cs:129:13:129:33 | After { ... } [no-match] | semmle.label | no-match | | patterns.cs:129:13:129:38 | ... => ... | patterns.cs:129:13:129:33 | Before { ... } | semmle.label | successor | @@ -235,6 +254,7 @@ | patterns.cs:129:22:129:30 | Before { ... } | patterns.cs:129:27:129:28 | 10 | semmle.label | successor | | patterns.cs:129:22:129:30 | { ... } | patterns.cs:129:22:129:30 | After { ... } | semmle.label | successor | | patterns.cs:129:27:129:28 | 10 | patterns.cs:129:22:129:30 | { ... } | semmle.label | successor | +| patterns.cs:129:32:129:33 | access to local variable ms | patterns.cs:129:13:129:33 | MyStruct ms | semmle.label | successor | | patterns.cs:129:38:129:38 | 1 | patterns.cs:126:17:132:9 | After ... switch { ... } | semmle.label | successor | | patterns.cs:130:13:130:18 | ( ... ) | patterns.cs:130:13:130:18 | After ( ... ) | semmle.label | successor | | patterns.cs:130:13:130:18 | After ( ... ) | patterns.cs:130:13:130:18 | { ... } | semmle.label | successor | @@ -254,11 +274,14 @@ | patterns.cs:131:13:131:22 | (..., ...) | patterns.cs:131:13:131:22 | After (..., ...) [no-match] | semmle.label | no-match | | patterns.cs:131:13:131:22 | After (..., ...) [match] | patterns.cs:131:13:131:27 | After ... => ... [match] | semmle.label | match | | patterns.cs:131:13:131:22 | After (..., ...) [no-match] | patterns.cs:131:13:131:27 | After ... => ... [no-match] | semmle.label | no-match | -| patterns.cs:131:13:131:22 | Before (..., ...) | patterns.cs:131:18:131:18 | Int32 x | semmle.label | successor | +| patterns.cs:131:13:131:22 | Before (..., ...) | patterns.cs:131:18:131:18 | Before Int32 x | semmle.label | successor | | patterns.cs:131:13:131:27 | ... => ... | patterns.cs:131:13:131:22 | Before (..., ...) | semmle.label | successor | | patterns.cs:131:13:131:27 | After ... => ... [match] | patterns.cs:131:27:131:27 | 3 | semmle.label | successor | | patterns.cs:131:13:131:27 | After ... => ... [no-match] | patterns.cs:126:17:132:9 | After ... switch { ... } | semmle.label | successor | -| patterns.cs:131:18:131:18 | Int32 x | patterns.cs:131:21:131:21 | _ | semmle.label | successor | +| patterns.cs:131:18:131:18 | After Int32 x | patterns.cs:131:21:131:21 | _ | semmle.label | successor | +| patterns.cs:131:18:131:18 | Before Int32 x | patterns.cs:131:18:131:18 | access to local variable x | semmle.label | successor | +| patterns.cs:131:18:131:18 | Int32 x | patterns.cs:131:18:131:18 | After Int32 x | semmle.label | successor | +| patterns.cs:131:18:131:18 | access to local variable x | patterns.cs:131:18:131:18 | Int32 x | semmle.label | successor | | patterns.cs:131:21:131:21 | _ | patterns.cs:131:13:131:22 | (..., ...) | semmle.label | successor | | patterns.cs:131:27:131:27 | 3 | patterns.cs:126:17:132:9 | After ... switch { ... } | semmle.label | successor | | patterns.cs:134:9:148:9 | After try {...} ... | patterns.cs:124:5:149:5 | After {...} | semmle.label | successor | @@ -297,11 +320,13 @@ | patterns.cs:139:22:139:22 | 3 | patterns.cs:136:17:143:13 | After ... switch { ... } | semmle.label | successor | | patterns.cs:140:17:140:24 | After Object y [match] | patterns.cs:140:17:140:42 | After ... => ... [match] | semmle.label | match | | patterns.cs:140:17:140:24 | After Object y [no-match] | patterns.cs:140:17:140:42 | After ... => ... [no-match] | semmle.label | no-match | +| patterns.cs:140:17:140:24 | Before Object y | patterns.cs:140:24:140:24 | access to local variable y | semmle.label | successor | | patterns.cs:140:17:140:24 | Object y | patterns.cs:140:17:140:24 | After Object y [match] | semmle.label | match | | patterns.cs:140:17:140:24 | Object y | patterns.cs:140:17:140:24 | After Object y [no-match] | semmle.label | no-match | -| patterns.cs:140:17:140:42 | ... => ... | patterns.cs:140:17:140:24 | Object y | semmle.label | successor | +| patterns.cs:140:17:140:42 | ... => ... | patterns.cs:140:17:140:24 | Before Object y | semmle.label | successor | | patterns.cs:140:17:140:42 | After ... => ... [match] | patterns.cs:140:31:140:37 | Before ... is ... | semmle.label | successor | | patterns.cs:140:17:140:42 | After ... => ... [no-match] | patterns.cs:141:17:141:29 | ... => ... | semmle.label | successor | +| patterns.cs:140:24:140:24 | access to local variable y | patterns.cs:140:17:140:24 | Object y | semmle.label | successor | | patterns.cs:140:31:140:31 | access to local variable y | patterns.cs:140:31:140:37 | ... is ... | semmle.label | successor | | patterns.cs:140:31:140:37 | ... is ... | patterns.cs:140:31:140:37 | After ... is ... [false] | semmle.label | false | | patterns.cs:140:31:140:37 | ... is ... | patterns.cs:140:31:140:37 | [MatchTrue] ... is ... | semmle.label | true | diff --git a/csharp/ql/test/library-tests/csharp8/switchstmtctrlflow.expected b/csharp/ql/test/library-tests/csharp8/switchstmtctrlflow.expected index ee5851bbd8f9..0492594663c8 100644 --- a/csharp/ql/test/library-tests/csharp8/switchstmtctrlflow.expected +++ b/csharp/ql/test/library-tests/csharp8/switchstmtctrlflow.expected @@ -24,11 +24,13 @@ | patterns.cs:36:17:36:17 | access to local variable s | patterns.cs:38:13:38:47 | case ...: | semmle.label | successor | | patterns.cs:38:13:38:47 | After case ...: [match] | patterns.cs:38:36:38:46 | Before ... == ... | semmle.label | successor | | patterns.cs:38:13:38:47 | After case ...: [no-match] | patterns.cs:41:13:41:46 | case ...: | semmle.label | successor | -| patterns.cs:38:13:38:47 | case ...: | patterns.cs:38:18:38:29 | MyStruct ms1 | semmle.label | successor | +| patterns.cs:38:13:38:47 | case ...: | patterns.cs:38:18:38:29 | Before MyStruct ms1 | semmle.label | successor | | patterns.cs:38:18:38:29 | After MyStruct ms1 [match] | patterns.cs:38:13:38:47 | After case ...: [match] | semmle.label | match | | patterns.cs:38:18:38:29 | After MyStruct ms1 [no-match] | patterns.cs:38:13:38:47 | After case ...: [no-match] | semmle.label | no-match | +| patterns.cs:38:18:38:29 | Before MyStruct ms1 | patterns.cs:38:27:38:29 | access to local variable ms1 | semmle.label | successor | | patterns.cs:38:18:38:29 | MyStruct ms1 | patterns.cs:38:18:38:29 | After MyStruct ms1 [match] | semmle.label | match | | patterns.cs:38:18:38:29 | MyStruct ms1 | patterns.cs:38:18:38:29 | After MyStruct ms1 [no-match] | semmle.label | no-match | +| patterns.cs:38:27:38:29 | access to local variable ms1 | patterns.cs:38:18:38:29 | MyStruct ms1 | semmle.label | successor | | patterns.cs:38:36:38:38 | access to local variable ms1 | patterns.cs:38:36:38:40 | access to field X | semmle.label | successor | | patterns.cs:38:36:38:40 | After access to field X | patterns.cs:38:45:38:46 | 10 | semmle.label | successor | | patterns.cs:38:36:38:40 | Before access to field X | patterns.cs:38:36:38:38 | access to local variable ms1 | semmle.label | successor | @@ -49,11 +51,13 @@ | patterns.cs:40:17:40:22 | break; | patterns.cs:36:9:44:9 | After switch (...) {...} | semmle.label | break | | patterns.cs:41:13:41:46 | After case ...: [match] | patterns.cs:41:36:41:45 | Before ... < ... | semmle.label | successor | | patterns.cs:41:13:41:46 | After case ...: [no-match] | patterns.cs:36:9:44:9 | After switch (...) {...} | semmle.label | successor | -| patterns.cs:41:13:41:46 | case ...: | patterns.cs:41:18:41:29 | MyStruct ms2 | semmle.label | successor | +| patterns.cs:41:13:41:46 | case ...: | patterns.cs:41:18:41:29 | Before MyStruct ms2 | semmle.label | successor | | patterns.cs:41:18:41:29 | After MyStruct ms2 [match] | patterns.cs:41:13:41:46 | After case ...: [match] | semmle.label | match | | patterns.cs:41:18:41:29 | After MyStruct ms2 [no-match] | patterns.cs:41:13:41:46 | After case ...: [no-match] | semmle.label | no-match | +| patterns.cs:41:18:41:29 | Before MyStruct ms2 | patterns.cs:41:27:41:29 | access to local variable ms2 | semmle.label | successor | | patterns.cs:41:18:41:29 | MyStruct ms2 | patterns.cs:41:18:41:29 | After MyStruct ms2 [match] | semmle.label | match | | patterns.cs:41:18:41:29 | MyStruct ms2 | patterns.cs:41:18:41:29 | After MyStruct ms2 [no-match] | semmle.label | no-match | +| patterns.cs:41:27:41:29 | access to local variable ms2 | patterns.cs:41:18:41:29 | MyStruct ms2 | semmle.label | successor | | patterns.cs:41:36:41:38 | access to local variable ms2 | patterns.cs:41:36:41:40 | access to field X | semmle.label | successor | | patterns.cs:41:36:41:40 | After access to field X | patterns.cs:41:44:41:45 | 10 | semmle.label | successor | | patterns.cs:41:36:41:40 | Before access to field X | patterns.cs:41:36:41:38 | access to local variable ms2 | semmle.label | successor | @@ -85,9 +89,12 @@ | patterns.cs:48:18:48:38 | { ... } | patterns.cs:48:18:48:38 | After { ... } [match] | semmle.label | match | | patterns.cs:48:18:48:38 | { ... } | patterns.cs:48:18:48:38 | After { ... } [no-match] | semmle.label | no-match | | patterns.cs:48:27:48:38 | After { ... } | patterns.cs:48:18:48:38 | { ... } | semmle.label | successor | -| patterns.cs:48:27:48:38 | Before { ... } | patterns.cs:48:32:48:36 | Int32 x | semmle.label | successor | +| patterns.cs:48:27:48:38 | Before { ... } | patterns.cs:48:32:48:36 | Before Int32 x | semmle.label | successor | | patterns.cs:48:27:48:38 | { ... } | patterns.cs:48:27:48:38 | After { ... } | semmle.label | successor | -| patterns.cs:48:32:48:36 | Int32 x | patterns.cs:48:27:48:38 | { ... } | semmle.label | successor | +| patterns.cs:48:32:48:36 | After Int32 x | patterns.cs:48:27:48:38 | { ... } | semmle.label | successor | +| patterns.cs:48:32:48:36 | Before Int32 x | patterns.cs:48:36:48:36 | access to local variable x | semmle.label | successor | +| patterns.cs:48:32:48:36 | Int32 x | patterns.cs:48:32:48:36 | After Int32 x | semmle.label | successor | +| patterns.cs:48:36:48:36 | access to local variable x | patterns.cs:48:32:48:36 | Int32 x | semmle.label | successor | | patterns.cs:48:45:48:45 | access to local variable x | patterns.cs:48:49:48:49 | 2 | semmle.label | successor | | patterns.cs:48:45:48:49 | ... > ... | patterns.cs:48:45:48:49 | After ... > ... [false] | semmle.label | false | | patterns.cs:48:45:48:49 | ... > ... | patterns.cs:48:45:48:49 | After ... > ... [true] | semmle.label | true | @@ -107,16 +114,19 @@ | patterns.cs:51:13:51:39 | After case ...: [no-match] | patterns.cs:54:13:54:43 | case ...: | semmle.label | successor | | patterns.cs:51:13:51:39 | case ...: | patterns.cs:51:18:51:38 | Before { ... } | semmle.label | successor | | patterns.cs:51:18:51:25 | access to type MyStruct | patterns.cs:51:27:51:35 | Before { ... } | semmle.label | successor | +| patterns.cs:51:18:51:38 | After MyStruct ms | patterns.cs:51:18:51:25 | access to type MyStruct | semmle.label | successor | | patterns.cs:51:18:51:38 | After { ... } [match] | patterns.cs:51:13:51:39 | After case ...: [match] | semmle.label | match | | patterns.cs:51:18:51:38 | After { ... } [no-match] | patterns.cs:51:13:51:39 | After case ...: [no-match] | semmle.label | no-match | -| patterns.cs:51:18:51:38 | Before { ... } | patterns.cs:51:18:51:38 | MyStruct ms | semmle.label | successor | -| patterns.cs:51:18:51:38 | MyStruct ms | patterns.cs:51:18:51:25 | access to type MyStruct | semmle.label | successor | +| patterns.cs:51:18:51:38 | Before MyStruct ms | patterns.cs:51:37:51:38 | access to local variable ms | semmle.label | successor | +| patterns.cs:51:18:51:38 | Before { ... } | patterns.cs:51:18:51:38 | Before MyStruct ms | semmle.label | successor | +| patterns.cs:51:18:51:38 | MyStruct ms | patterns.cs:51:18:51:38 | After MyStruct ms | semmle.label | successor | | patterns.cs:51:18:51:38 | { ... } | patterns.cs:51:18:51:38 | After { ... } [match] | semmle.label | match | | patterns.cs:51:18:51:38 | { ... } | patterns.cs:51:18:51:38 | After { ... } [no-match] | semmle.label | no-match | | patterns.cs:51:27:51:35 | After { ... } | patterns.cs:51:18:51:38 | { ... } | semmle.label | successor | | patterns.cs:51:27:51:35 | Before { ... } | patterns.cs:51:32:51:33 | 10 | semmle.label | successor | | patterns.cs:51:27:51:35 | { ... } | patterns.cs:51:27:51:35 | After { ... } | semmle.label | successor | | patterns.cs:51:32:51:33 | 10 | patterns.cs:51:27:51:35 | { ... } | semmle.label | successor | +| patterns.cs:51:37:51:38 | access to local variable ms | patterns.cs:51:18:51:38 | MyStruct ms | semmle.label | successor | | patterns.cs:52:17:52:55 | After call to method WriteLine | patterns.cs:52:17:52:56 | After ...; | semmle.label | successor | | patterns.cs:52:17:52:55 | Before call to method WriteLine | patterns.cs:52:35:52:54 | "Hit the breakpoint" | semmle.label | successor | | patterns.cs:52:17:52:55 | call to method WriteLine | patterns.cs:52:17:52:55 | After call to method WriteLine | semmle.label | successor | @@ -132,11 +142,14 @@ | patterns.cs:54:18:54:30 | After { ... } [match] | patterns.cs:54:13:54:43 | After case ...: [match] | semmle.label | match | | patterns.cs:54:18:54:30 | After { ... } [no-match] | patterns.cs:54:13:54:43 | After case ...: [no-match] | semmle.label | no-match | | patterns.cs:54:18:54:30 | Before { ... } | patterns.cs:54:18:54:30 | Before { ... } | semmle.label | successor | -| patterns.cs:54:18:54:30 | Before { ... } | patterns.cs:54:23:54:28 | Int32 x2 | semmle.label | successor | +| patterns.cs:54:18:54:30 | Before { ... } | patterns.cs:54:23:54:28 | Before Int32 x2 | semmle.label | successor | | patterns.cs:54:18:54:30 | { ... } | patterns.cs:54:18:54:30 | After { ... } | semmle.label | successor | | patterns.cs:54:18:54:30 | { ... } | patterns.cs:54:18:54:30 | After { ... } [match] | semmle.label | match | | patterns.cs:54:18:54:30 | { ... } | patterns.cs:54:18:54:30 | After { ... } [no-match] | semmle.label | no-match | -| patterns.cs:54:23:54:28 | Int32 x2 | patterns.cs:54:18:54:30 | { ... } | semmle.label | successor | +| patterns.cs:54:23:54:28 | After Int32 x2 | patterns.cs:54:18:54:30 | { ... } | semmle.label | successor | +| patterns.cs:54:23:54:28 | Before Int32 x2 | patterns.cs:54:27:54:28 | access to local variable x2 | semmle.label | successor | +| patterns.cs:54:23:54:28 | Int32 x2 | patterns.cs:54:23:54:28 | After Int32 x2 | semmle.label | successor | +| patterns.cs:54:27:54:28 | access to local variable x2 | patterns.cs:54:23:54:28 | Int32 x2 | semmle.label | successor | | patterns.cs:54:37:54:38 | access to local variable x2 | patterns.cs:54:42:54:42 | 2 | semmle.label | successor | | patterns.cs:54:37:54:42 | ... > ... | patterns.cs:54:37:54:42 | After ... > ... [false] | semmle.label | false | | patterns.cs:54:37:54:42 | ... > ... | patterns.cs:54:37:54:42 | After ... > ... [true] | semmle.label | true | @@ -174,9 +187,15 @@ | patterns.cs:59:18:59:27 | (..., ...) | patterns.cs:59:18:59:27 | After (..., ...) [no-match] | semmle.label | no-match | | patterns.cs:59:18:59:27 | After (..., ...) [match] | patterns.cs:59:13:59:28 | After case ...: [match] | semmle.label | match | | patterns.cs:59:18:59:27 | After (..., ...) [no-match] | patterns.cs:59:13:59:28 | After case ...: [no-match] | semmle.label | no-match | -| patterns.cs:59:18:59:27 | Before (..., ...) | patterns.cs:59:23:59:23 | Int32 x | semmle.label | successor | -| patterns.cs:59:23:59:23 | Int32 x | patterns.cs:59:26:59:26 | Int32 y | semmle.label | successor | -| patterns.cs:59:26:59:26 | Int32 y | patterns.cs:59:18:59:27 | (..., ...) | semmle.label | successor | +| patterns.cs:59:18:59:27 | Before (..., ...) | patterns.cs:59:23:59:23 | Before Int32 x | semmle.label | successor | +| patterns.cs:59:23:59:23 | After Int32 x | patterns.cs:59:26:59:26 | Before Int32 y | semmle.label | successor | +| patterns.cs:59:23:59:23 | Before Int32 x | patterns.cs:59:23:59:23 | access to local variable x | semmle.label | successor | +| patterns.cs:59:23:59:23 | Int32 x | patterns.cs:59:23:59:23 | After Int32 x | semmle.label | successor | +| patterns.cs:59:23:59:23 | access to local variable x | patterns.cs:59:23:59:23 | Int32 x | semmle.label | successor | +| patterns.cs:59:26:59:26 | After Int32 y | patterns.cs:59:18:59:27 | (..., ...) | semmle.label | successor | +| patterns.cs:59:26:59:26 | Before Int32 y | patterns.cs:59:26:59:26 | access to local variable y | semmle.label | successor | +| patterns.cs:59:26:59:26 | Int32 y | patterns.cs:59:26:59:26 | After Int32 y | semmle.label | successor | +| patterns.cs:59:26:59:26 | access to local variable y | patterns.cs:59:26:59:26 | Int32 y | semmle.label | successor | | patterns.cs:60:17:60:22 | Before break; | patterns.cs:60:17:60:22 | break; | semmle.label | successor | | patterns.cs:60:17:60:22 | break; | patterns.cs:46:9:63:9 | After switch (...) {...} | semmle.label | break | | patterns.cs:61:13:61:20 | After default: [match] | patterns.cs:62:17:62:22 | Before break; | semmle.label | successor | @@ -196,9 +215,12 @@ | patterns.cs:67:18:67:38 | { ... } | patterns.cs:67:18:67:38 | After { ... } [match] | semmle.label | match | | patterns.cs:67:18:67:38 | { ... } | patterns.cs:67:18:67:38 | After { ... } [no-match] | semmle.label | no-match | | patterns.cs:67:27:67:38 | After { ... } | patterns.cs:67:18:67:38 | { ... } | semmle.label | successor | -| patterns.cs:67:27:67:38 | Before { ... } | patterns.cs:67:32:67:36 | Int32 x | semmle.label | successor | +| patterns.cs:67:27:67:38 | Before { ... } | patterns.cs:67:32:67:36 | Before Int32 x | semmle.label | successor | | patterns.cs:67:27:67:38 | { ... } | patterns.cs:67:27:67:38 | After { ... } | semmle.label | successor | -| patterns.cs:67:32:67:36 | Int32 x | patterns.cs:67:27:67:38 | { ... } | semmle.label | successor | +| patterns.cs:67:32:67:36 | After Int32 x | patterns.cs:67:27:67:38 | { ... } | semmle.label | successor | +| patterns.cs:67:32:67:36 | Before Int32 x | patterns.cs:67:36:67:36 | access to local variable x | semmle.label | successor | +| patterns.cs:67:32:67:36 | Int32 x | patterns.cs:67:32:67:36 | After Int32 x | semmle.label | successor | +| patterns.cs:67:36:67:36 | access to local variable x | patterns.cs:67:32:67:36 | Int32 x | semmle.label | successor | | patterns.cs:67:45:67:45 | access to local variable x | patterns.cs:67:49:67:49 | 2 | semmle.label | successor | | patterns.cs:67:45:67:49 | ... > ... | patterns.cs:67:45:67:49 | After ... > ... [false] | semmle.label | false | | patterns.cs:67:45:67:49 | ... > ... | patterns.cs:67:45:67:49 | After ... > ... [true] | semmle.label | true | @@ -218,16 +240,19 @@ | patterns.cs:70:13:70:51 | After case ...: [no-match] | patterns.cs:65:9:73:9 | After switch (...) {...} | semmle.label | successor | | patterns.cs:70:13:70:51 | case ...: | patterns.cs:70:18:70:38 | Before { ... } | semmle.label | successor | | patterns.cs:70:18:70:25 | access to type MyStruct | patterns.cs:70:27:70:35 | Before { ... } | semmle.label | successor | +| patterns.cs:70:18:70:38 | After MyStruct ms | patterns.cs:70:18:70:25 | access to type MyStruct | semmle.label | successor | | patterns.cs:70:18:70:38 | After { ... } [match] | patterns.cs:70:13:70:51 | After case ...: [match] | semmle.label | match | | patterns.cs:70:18:70:38 | After { ... } [no-match] | patterns.cs:70:13:70:51 | After case ...: [no-match] | semmle.label | no-match | -| patterns.cs:70:18:70:38 | Before { ... } | patterns.cs:70:18:70:38 | MyStruct ms | semmle.label | successor | -| patterns.cs:70:18:70:38 | MyStruct ms | patterns.cs:70:18:70:25 | access to type MyStruct | semmle.label | successor | +| patterns.cs:70:18:70:38 | Before MyStruct ms | patterns.cs:70:37:70:38 | access to local variable ms | semmle.label | successor | +| patterns.cs:70:18:70:38 | Before { ... } | patterns.cs:70:18:70:38 | Before MyStruct ms | semmle.label | successor | +| patterns.cs:70:18:70:38 | MyStruct ms | patterns.cs:70:18:70:38 | After MyStruct ms | semmle.label | successor | | patterns.cs:70:18:70:38 | { ... } | patterns.cs:70:18:70:38 | After { ... } [match] | semmle.label | match | | patterns.cs:70:18:70:38 | { ... } | patterns.cs:70:18:70:38 | After { ... } [no-match] | semmle.label | no-match | | patterns.cs:70:27:70:35 | After { ... } | patterns.cs:70:18:70:38 | { ... } | semmle.label | successor | | patterns.cs:70:27:70:35 | Before { ... } | patterns.cs:70:32:70:33 | 10 | semmle.label | successor | | patterns.cs:70:27:70:35 | { ... } | patterns.cs:70:27:70:35 | After { ... } | semmle.label | successor | | patterns.cs:70:32:70:33 | 10 | patterns.cs:70:27:70:35 | { ... } | semmle.label | successor | +| patterns.cs:70:37:70:38 | access to local variable ms | patterns.cs:70:18:70:38 | MyStruct ms | semmle.label | successor | | patterns.cs:70:45:70:45 | access to local variable s | patterns.cs:70:45:70:47 | access to field X | semmle.label | successor | | patterns.cs:70:45:70:47 | After access to field X | patterns.cs:70:50:70:50 | 0 | semmle.label | successor | | patterns.cs:70:45:70:47 | Before access to field X | patterns.cs:70:45:70:45 | access to local variable s | semmle.label | successor | @@ -258,12 +283,18 @@ | patterns.cs:78:18:78:33 | After ( ... ) | patterns.cs:78:18:78:33 | { ... } | semmle.label | successor | | patterns.cs:78:18:78:33 | After { ... } [match] | patterns.cs:78:13:78:43 | After case ...: [match] | semmle.label | match | | patterns.cs:78:18:78:33 | After { ... } [no-match] | patterns.cs:78:13:78:43 | After case ...: [no-match] | semmle.label | no-match | -| patterns.cs:78:18:78:33 | Before ( ... ) | patterns.cs:78:19:78:23 | Int32 x | semmle.label | successor | +| patterns.cs:78:18:78:33 | Before ( ... ) | patterns.cs:78:19:78:23 | Before Int32 x | semmle.label | successor | | patterns.cs:78:18:78:33 | Before { ... } | patterns.cs:78:18:78:33 | Before ( ... ) | semmle.label | successor | | patterns.cs:78:18:78:33 | { ... } | patterns.cs:78:18:78:33 | After { ... } [match] | semmle.label | match | | patterns.cs:78:18:78:33 | { ... } | patterns.cs:78:18:78:33 | After { ... } [no-match] | semmle.label | no-match | -| patterns.cs:78:19:78:23 | Int32 x | patterns.cs:78:26:78:32 | Single y | semmle.label | successor | -| patterns.cs:78:26:78:32 | Single y | patterns.cs:78:18:78:33 | ( ... ) | semmle.label | successor | +| patterns.cs:78:19:78:23 | After Int32 x | patterns.cs:78:26:78:32 | Before Single y | semmle.label | successor | +| patterns.cs:78:19:78:23 | Before Int32 x | patterns.cs:78:23:78:23 | access to local variable x | semmle.label | successor | +| patterns.cs:78:19:78:23 | Int32 x | patterns.cs:78:19:78:23 | After Int32 x | semmle.label | successor | +| patterns.cs:78:23:78:23 | access to local variable x | patterns.cs:78:19:78:23 | Int32 x | semmle.label | successor | +| patterns.cs:78:26:78:32 | After Single y | patterns.cs:78:18:78:33 | ( ... ) | semmle.label | successor | +| patterns.cs:78:26:78:32 | Before Single y | patterns.cs:78:32:78:32 | access to local variable y | semmle.label | successor | +| patterns.cs:78:26:78:32 | Single y | patterns.cs:78:26:78:32 | After Single y | semmle.label | successor | +| patterns.cs:78:32:78:32 | access to local variable y | patterns.cs:78:26:78:32 | Single y | semmle.label | successor | | patterns.cs:78:40:78:40 | (...) ... | patterns.cs:78:40:78:40 | After (...) ... | semmle.label | successor | | patterns.cs:78:40:78:40 | After (...) ... | patterns.cs:78:42:78:42 | access to local variable y | semmle.label | successor | | patterns.cs:78:40:78:40 | Before (...) ... | patterns.cs:78:40:78:40 | access to local variable x | semmle.label | successor | @@ -338,8 +369,11 @@ | patterns.cs:93:18:93:27 | Before { ... } | patterns.cs:93:18:93:27 | Before ( ... ) | semmle.label | successor | | patterns.cs:93:18:93:27 | { ... } | patterns.cs:93:18:93:27 | After { ... } [match] | semmle.label | match | | patterns.cs:93:18:93:27 | { ... } | patterns.cs:93:18:93:27 | After { ... } [no-match] | semmle.label | no-match | -| patterns.cs:93:19:93:19 | 1 | patterns.cs:93:22:93:26 | Int32 x | semmle.label | successor | -| patterns.cs:93:22:93:26 | Int32 x | patterns.cs:93:18:93:27 | ( ... ) | semmle.label | successor | +| patterns.cs:93:19:93:19 | 1 | patterns.cs:93:22:93:26 | Before Int32 x | semmle.label | successor | +| patterns.cs:93:22:93:26 | After Int32 x | patterns.cs:93:18:93:27 | ( ... ) | semmle.label | successor | +| patterns.cs:93:22:93:26 | Before Int32 x | patterns.cs:93:26:93:26 | access to local variable x | semmle.label | successor | +| patterns.cs:93:22:93:26 | Int32 x | patterns.cs:93:22:93:26 | After Int32 x | semmle.label | successor | +| patterns.cs:93:26:93:26 | access to local variable x | patterns.cs:93:22:93:26 | Int32 x | semmle.label | successor | | patterns.cs:93:30:93:35 | Before break; | patterns.cs:93:30:93:35 | break; | semmle.label | successor | | patterns.cs:93:30:93:35 | break; | patterns.cs:91:9:95:9 | After switch (...) {...} | semmle.label | break | | patterns.cs:94:13:94:24 | After case ...: [match] | patterns.cs:94:26:94:31 | Before break; | semmle.label | successor | diff --git a/csharp/ql/test/library-tests/csharp9/PrintAst.expected b/csharp/ql/test/library-tests/csharp9/PrintAst.expected index f86c98e4c6cf..fa583a85965d 100644 --- a/csharp/ql/test/library-tests/csharp9/PrintAst.expected +++ b/csharp/ql/test/library-tests/csharp9/PrintAst.expected @@ -84,9 +84,11 @@ BinaryPattern.cs: # 10| 0: [ParameterAccess] access to parameter c # 10| 1: [AndPatternExpr] ... and ... # 10| 0: [VariablePatternExpr] Object o -# 10| 0: [TypeMention] object +# 10| -1: [TypeMention] object +# 10| 0: [LocalVariableAccess] access to local variable o # 10| 1: [RecursivePatternExpr] { ... } # 10| 0: [VariablePatternExpr] BinaryPattern u +# 10| 0: [LocalVariableAccess] access to local variable u # 10| 1: [TypeAccessPatternExpr] access to type BinaryPattern # 10| 0: [TypeMention] BinaryPattern # 10| 3: [PropertyPatternExpr] { ... } @@ -100,9 +102,11 @@ BinaryPattern.cs: # 12| 0: [ParameterAccess] access to parameter c # 12| 1: [AndPatternExpr] ... and ... # 12| 0: [VariablePatternExpr] Object o -# 12| 0: [TypeMention] object +# 12| -1: [TypeMention] object +# 12| 0: [LocalVariableAccess] access to local variable o # 12| 1: [VariablePatternExpr] BinaryPattern u -# 12| 0: [TypeMention] BinaryPattern +# 12| -1: [TypeMention] BinaryPattern +# 12| 0: [LocalVariableAccess] access to local variable u # 14| 10: [Method] M4 # 14| -1: [TypeMention] string #-----| 2: (Parameters) @@ -729,6 +733,7 @@ ParenthesizedPattern.cs: # 9| 0: [ParameterAccess] access to parameter o # 9| 1: [RecursivePatternExpr] { ... } # 9| 0: [VariablePatternExpr] Object p1 +# 9| 0: [LocalVariableAccess] access to local variable p1 # 9| 3: [PropertyPatternExpr] { ... } # 10| 1: [BlockStmt] {...} # 13| 1: [IfStmt] if (...) ... @@ -736,6 +741,7 @@ ParenthesizedPattern.cs: # 13| 0: [ParameterAccess] access to parameter o # 13| 1: [RecursivePatternExpr] { ... } # 13| 0: [VariablePatternExpr] Object p2 +# 13| 0: [LocalVariableAccess] access to local variable p2 # 13| 3: [PropertyPatternExpr] { ... } # 14| 1: [BlockStmt] {...} # 18| 7: [Method] M2 @@ -758,7 +764,8 @@ ParenthesizedPattern.cs: # 23| 2: [IntLiteral] 2 # 24| 2: [SwitchCaseExpr] ... => ... # 24| 0: [VariablePatternExpr] T t -# 24| 0: [TypeMention] T +# 24| -1: [TypeMention] T +# 24| 0: [LocalVariableAccess] access to local variable t # 24| 1: [IsExpr] ... is ... # 24| 0: [LocalVariableAccess] access to local variable t # 24| 1: [RecursivePatternExpr] { ... } @@ -766,7 +773,8 @@ ParenthesizedPattern.cs: # 24| 2: [IntLiteral] 3 # 25| 3: [SwitchCaseExpr] ... => ... # 25| 0: [VariablePatternExpr] Object o1 -# 25| 0: [TypeMention] object +# 25| -1: [TypeMention] object +# 25| 0: [LocalVariableAccess] access to local variable o1 # 25| 1: [IsExpr] ... is ... # 25| 0: [LocalVariableAccess] access to local variable o1 # 25| 1: [RecursivePatternExpr] { ... } @@ -1502,7 +1510,8 @@ TypePattern.cs: # 11| 1: [IntLiteral] 1 # 12| 1: [SwitchCaseExpr] ... => ... # 12| 0: [VariablePatternExpr] Double d -# 12| 0: [TypeMention] double +# 12| -1: [TypeMention] double +# 12| 0: [LocalVariableAccess] access to local variable d # 12| 2: [CastExpr] (...) ... # 12| 1: [LocalVariableAccess] access to local variable d # 13| 2: [SwitchCaseExpr] ... => ... @@ -1512,7 +1521,8 @@ TypePattern.cs: # 13| 1: [IntLiteral] 3 # 14| 3: [SwitchCaseExpr] ... => ... # 14| 0: [VariablePatternExpr] Object o -# 14| 0: [TypeMention] object +# 14| -1: [TypeMention] object +# 14| 0: [LocalVariableAccess] access to local variable o # 14| 2: [LocalVariableAccess] access to local variable o UnaryPattern.cs: # 3| [Class] UnaryPattern @@ -1550,6 +1560,7 @@ UnaryPattern.cs: # 12| 1: [NotPatternExpr] not ... # 12| 0: [RecursivePatternExpr] { ... } # 12| 0: [VariablePatternExpr] UnaryPattern u +# 12| 0: [LocalVariableAccess] access to local variable u # 12| 1: [TypeAccessPatternExpr] access to type UnaryPattern # 12| 0: [TypeMention] UnaryPattern # 12| 3: [PropertyPatternExpr] { ... } diff --git a/csharp/ql/test/library-tests/dataflow/patterns/PatternFlow.expected b/csharp/ql/test/library-tests/dataflow/patterns/PatternFlow.expected index a9b4eb935298..2fbf03cb317e 100644 --- a/csharp/ql/test/library-tests/dataflow/patterns/PatternFlow.expected +++ b/csharp/ql/test/library-tests/dataflow/patterns/PatternFlow.expected @@ -16,8 +16,10 @@ edges | Patterns.cs:22:33:22:33 | access to local variable o : Object | Patterns.cs:3:40:3:43 | Prop : Object | provenance | | | Patterns.cs:22:33:22:33 | access to local variable o : Object | Patterns.cs:22:17:22:34 | object creation of type RecordClass : RecordClass [property Prop] : Object | provenance | | | Patterns.cs:22:33:22:33 | access to local variable o : Object | Patterns.cs:22:17:22:34 | object creation of type RecordClass : RecordClass [property Prop] : Object | provenance | | -| Patterns.cs:23:18:23:47 | { ... } : RecordClass [property Prop] : Object | Patterns.cs:25:18:25:18 | access to local variable p | provenance | | -| Patterns.cs:23:18:23:47 | { ... } : RecordClass [property Prop] : Object | Patterns.cs:25:18:25:18 | access to local variable p | provenance | | +| Patterns.cs:23:18:23:47 | { ... } : RecordClass [property Prop] : Object | Patterns.cs:23:45:23:45 | access to local variable p : Object | provenance | | +| Patterns.cs:23:18:23:47 | { ... } : RecordClass [property Prop] : Object | Patterns.cs:23:45:23:45 | access to local variable p : Object | provenance | | +| Patterns.cs:23:45:23:45 | access to local variable p : Object | Patterns.cs:25:18:25:18 | access to local variable p | provenance | | +| Patterns.cs:23:45:23:45 | access to local variable p : Object | Patterns.cs:25:18:25:18 | access to local variable p | provenance | | | Patterns.cs:31:13:31:13 | access to local variable o : Object | Patterns.cs:32:33:32:33 | access to local variable o : Object | provenance | | | Patterns.cs:31:13:31:13 | access to local variable o : Object | Patterns.cs:32:33:32:33 | access to local variable o : Object | provenance | | | Patterns.cs:31:17:31:33 | call to method Source : Object | Patterns.cs:31:13:31:13 | access to local variable o : Object | provenance | | @@ -30,8 +32,10 @@ edges | Patterns.cs:32:33:32:33 | access to local variable o : Object | Patterns.cs:3:40:3:43 | Prop : Object | provenance | | | Patterns.cs:32:33:32:33 | access to local variable o : Object | Patterns.cs:32:17:32:34 | object creation of type RecordClass : RecordClass [property Prop] : Object | provenance | | | Patterns.cs:32:33:32:33 | access to local variable o : Object | Patterns.cs:32:17:32:34 | object creation of type RecordClass : RecordClass [property Prop] : Object | provenance | | -| Patterns.cs:35:18:35:47 | { ... } : RecordClass [property Prop] : Object | Patterns.cs:36:22:36:22 | access to local variable p | provenance | | -| Patterns.cs:35:18:35:47 | { ... } : RecordClass [property Prop] : Object | Patterns.cs:36:22:36:22 | access to local variable p | provenance | | +| Patterns.cs:35:18:35:47 | { ... } : RecordClass [property Prop] : Object | Patterns.cs:35:45:35:45 | access to local variable p : Object | provenance | | +| Patterns.cs:35:18:35:47 | { ... } : RecordClass [property Prop] : Object | Patterns.cs:35:45:35:45 | access to local variable p : Object | provenance | | +| Patterns.cs:35:45:35:45 | access to local variable p : Object | Patterns.cs:36:22:36:22 | access to local variable p | provenance | | +| Patterns.cs:35:45:35:45 | access to local variable p : Object | Patterns.cs:36:22:36:22 | access to local variable p | provenance | | | Patterns.cs:43:13:43:13 | access to local variable o : Object | Patterns.cs:44:44:44:44 | access to local variable o : Object | provenance | | | Patterns.cs:43:13:43:13 | access to local variable o : Object | Patterns.cs:44:44:44:44 | access to local variable o : Object | provenance | | | Patterns.cs:43:17:43:33 | call to method Source : Object | Patterns.cs:43:13:43:13 | access to local variable o : Object | provenance | | @@ -50,8 +54,10 @@ edges | Patterns.cs:44:44:44:44 | access to local variable o : Object | Patterns.cs:44:28:44:45 | object creation of type RecordClass : RecordClass [property Prop] : Object | provenance | | | Patterns.cs:45:18:45:54 | { ... } : Nested [property Record, property Prop] : Object | Patterns.cs:45:35:45:52 | { ... } : RecordClass [property Prop] : Object | provenance | | | Patterns.cs:45:18:45:54 | { ... } : Nested [property Record, property Prop] : Object | Patterns.cs:45:35:45:52 | { ... } : RecordClass [property Prop] : Object | provenance | | -| Patterns.cs:45:35:45:52 | { ... } : RecordClass [property Prop] : Object | Patterns.cs:47:18:47:18 | access to local variable p | provenance | | -| Patterns.cs:45:35:45:52 | { ... } : RecordClass [property Prop] : Object | Patterns.cs:47:18:47:18 | access to local variable p | provenance | | +| Patterns.cs:45:35:45:52 | { ... } : RecordClass [property Prop] : Object | Patterns.cs:45:50:45:50 | access to local variable p : Object | provenance | | +| Patterns.cs:45:35:45:52 | { ... } : RecordClass [property Prop] : Object | Patterns.cs:45:50:45:50 | access to local variable p : Object | provenance | | +| Patterns.cs:45:50:45:50 | access to local variable p : Object | Patterns.cs:47:18:47:18 | access to local variable p | provenance | | +| Patterns.cs:45:50:45:50 | access to local variable p : Object | Patterns.cs:47:18:47:18 | access to local variable p | provenance | | | Patterns.cs:53:13:53:13 | access to local variable o : Object | Patterns.cs:54:44:54:44 | access to local variable o : Object | provenance | | | Patterns.cs:53:13:53:13 | access to local variable o : Object | Patterns.cs:54:44:54:44 | access to local variable o : Object | provenance | | | Patterns.cs:53:17:53:33 | call to method Source : Object | Patterns.cs:53:13:53:13 | access to local variable o : Object | provenance | | @@ -70,8 +76,10 @@ edges | Patterns.cs:54:44:54:44 | access to local variable o : Object | Patterns.cs:54:28:54:45 | object creation of type RecordClass : RecordClass [property Prop] : Object | provenance | | | Patterns.cs:55:18:55:49 | { ... } : Nested [property Record, property Prop] : Object | Patterns.cs:55:27:55:32 | { ... } : null [property Prop] : Object | provenance | | | Patterns.cs:55:18:55:49 | { ... } : Nested [property Record, property Prop] : Object | Patterns.cs:55:27:55:32 | { ... } : null [property Prop] : Object | provenance | | -| Patterns.cs:55:27:55:32 | { ... } : null [property Prop] : Object | Patterns.cs:57:18:57:18 | access to local variable p | provenance | | -| Patterns.cs:55:27:55:32 | { ... } : null [property Prop] : Object | Patterns.cs:57:18:57:18 | access to local variable p | provenance | | +| Patterns.cs:55:27:55:32 | { ... } : null [property Prop] : Object | Patterns.cs:55:47:55:47 | access to local variable p : Object | provenance | | +| Patterns.cs:55:27:55:32 | { ... } : null [property Prop] : Object | Patterns.cs:55:47:55:47 | access to local variable p : Object | provenance | | +| Patterns.cs:55:47:55:47 | access to local variable p : Object | Patterns.cs:57:18:57:18 | access to local variable p | provenance | | +| Patterns.cs:55:47:55:47 | access to local variable p : Object | Patterns.cs:57:18:57:18 | access to local variable p | provenance | | | Patterns.cs:63:13:63:13 | access to local variable o : Object | Patterns.cs:64:41:64:41 | access to local variable o : Object | provenance | | | Patterns.cs:63:13:63:13 | access to local variable o : Object | Patterns.cs:64:41:64:41 | access to local variable o : Object | provenance | | | Patterns.cs:63:17:63:33 | call to method Source : Object | Patterns.cs:63:13:63:13 | access to local variable o : Object | provenance | | @@ -82,8 +90,10 @@ edges | Patterns.cs:64:32:64:43 | { ..., ... } : C1 [property Prop] : Object | Patterns.cs:64:13:64:13 | access to local variable c : C1 [property Prop] : Object | provenance | | | Patterns.cs:64:41:64:41 | access to local variable o : Object | Patterns.cs:64:32:64:43 | { ..., ... } : C1 [property Prop] : Object | provenance | | | Patterns.cs:64:41:64:41 | access to local variable o : Object | Patterns.cs:64:32:64:43 | { ..., ... } : C1 [property Prop] : Object | provenance | | -| Patterns.cs:65:18:65:46 | { ... } : C1 [property Prop] : Object | Patterns.cs:67:18:67:18 | access to local variable p | provenance | | -| Patterns.cs:65:18:65:46 | { ... } : C1 [property Prop] : Object | Patterns.cs:67:18:67:18 | access to local variable p | provenance | | +| Patterns.cs:65:18:65:46 | { ... } : C1 [property Prop] : Object | Patterns.cs:65:44:65:44 | access to local variable p : Object | provenance | | +| Patterns.cs:65:18:65:46 | { ... } : C1 [property Prop] : Object | Patterns.cs:65:44:65:44 | access to local variable p : Object | provenance | | +| Patterns.cs:65:44:65:44 | access to local variable p : Object | Patterns.cs:67:18:67:18 | access to local variable p | provenance | | +| Patterns.cs:65:44:65:44 | access to local variable p : Object | Patterns.cs:67:18:67:18 | access to local variable p | provenance | | | Patterns.cs:73:13:73:13 | access to local variable o : Object | Patterns.cs:74:44:74:44 | access to local variable o : Object | provenance | | | Patterns.cs:73:13:73:13 | access to local variable o : Object | Patterns.cs:74:44:74:44 | access to local variable o : Object | provenance | | | Patterns.cs:73:17:73:33 | call to method Source : Object | Patterns.cs:73:13:73:13 | access to local variable o : Object | provenance | | @@ -100,8 +110,10 @@ edges | Patterns.cs:74:44:74:44 | access to local variable o : Object | Patterns.cs:3:40:3:43 | Prop : Object | provenance | | | Patterns.cs:74:44:74:44 | access to local variable o : Object | Patterns.cs:74:28:74:45 | object creation of type RecordClass : RecordClass [property Prop] : Object | provenance | | | Patterns.cs:74:44:74:44 | access to local variable o : Object | Patterns.cs:74:28:74:45 | object creation of type RecordClass : RecordClass [property Prop] : Object | provenance | | -| Patterns.cs:75:18:75:65 | { ... } : Nested [property Record, property Prop] : Object | Patterns.cs:77:18:77:18 | access to local variable r : RecordClass [property Prop] : Object | provenance | | -| Patterns.cs:75:18:75:65 | { ... } : Nested [property Record, property Prop] : Object | Patterns.cs:77:18:77:18 | access to local variable r : RecordClass [property Prop] : Object | provenance | | +| Patterns.cs:75:18:75:65 | { ... } : Nested [property Record, property Prop] : Object | Patterns.cs:75:63:75:63 | access to local variable r : RecordClass [property Prop] : Object | provenance | | +| Patterns.cs:75:18:75:65 | { ... } : Nested [property Record, property Prop] : Object | Patterns.cs:75:63:75:63 | access to local variable r : RecordClass [property Prop] : Object | provenance | | +| Patterns.cs:75:63:75:63 | access to local variable r : RecordClass [property Prop] : Object | Patterns.cs:77:18:77:18 | access to local variable r : RecordClass [property Prop] : Object | provenance | | +| Patterns.cs:75:63:75:63 | access to local variable r : RecordClass [property Prop] : Object | Patterns.cs:77:18:77:18 | access to local variable r : RecordClass [property Prop] : Object | provenance | | | Patterns.cs:77:18:77:18 | access to local variable r : RecordClass [property Prop] : Object | Patterns.cs:77:18:77:23 | access to property Prop | provenance | | | Patterns.cs:77:18:77:18 | access to local variable r : RecordClass [property Prop] : Object | Patterns.cs:77:18:77:23 | access to property Prop | provenance | | | Patterns.cs:83:13:83:14 | access to local variable o1 : Object | Patterns.cs:85:45:85:46 | access to local variable o1 : Object | provenance | | @@ -134,12 +146,16 @@ edges | Patterns.cs:85:51:85:52 | access to local variable o2 : Object | Patterns.cs:85:17:85:53 | (..., ...) : ValueTuple [field Item2] : Object | provenance | | | Patterns.cs:88:18:88:63 | { ... } : ValueTuple [field Item1, property Record, property Prop] : Object | Patterns.cs:88:19:88:55 | { ... } : Nested [property Record, property Prop] : Object | provenance | | | Patterns.cs:88:18:88:63 | { ... } : ValueTuple [field Item1, property Record, property Prop] : Object | Patterns.cs:88:19:88:55 | { ... } : Nested [property Record, property Prop] : Object | provenance | | -| Patterns.cs:88:18:88:63 | { ... } : ValueTuple [field Item2] : Object | Patterns.cs:90:22:90:22 | access to local variable o | provenance | | -| Patterns.cs:88:18:88:63 | { ... } : ValueTuple [field Item2] : Object | Patterns.cs:90:22:90:22 | access to local variable o | provenance | | +| Patterns.cs:88:18:88:63 | { ... } : ValueTuple [field Item2] : Object | Patterns.cs:88:62:88:62 | access to local variable o : Object | provenance | | +| Patterns.cs:88:18:88:63 | { ... } : ValueTuple [field Item2] : Object | Patterns.cs:88:62:88:62 | access to local variable o : Object | provenance | | | Patterns.cs:88:19:88:55 | { ... } : Nested [property Record, property Prop] : Object | Patterns.cs:88:36:88:53 | { ... } : RecordClass [property Prop] : Object | provenance | | | Patterns.cs:88:19:88:55 | { ... } : Nested [property Record, property Prop] : Object | Patterns.cs:88:36:88:53 | { ... } : RecordClass [property Prop] : Object | provenance | | -| Patterns.cs:88:36:88:53 | { ... } : RecordClass [property Prop] : Object | Patterns.cs:89:22:89:22 | access to local variable p | provenance | | -| Patterns.cs:88:36:88:53 | { ... } : RecordClass [property Prop] : Object | Patterns.cs:89:22:89:22 | access to local variable p | provenance | | +| Patterns.cs:88:36:88:53 | { ... } : RecordClass [property Prop] : Object | Patterns.cs:88:51:88:51 | access to local variable p : Object | provenance | | +| Patterns.cs:88:36:88:53 | { ... } : RecordClass [property Prop] : Object | Patterns.cs:88:51:88:51 | access to local variable p : Object | provenance | | +| Patterns.cs:88:51:88:51 | access to local variable p : Object | Patterns.cs:89:22:89:22 | access to local variable p | provenance | | +| Patterns.cs:88:51:88:51 | access to local variable p : Object | Patterns.cs:89:22:89:22 | access to local variable p | provenance | | +| Patterns.cs:88:62:88:62 | access to local variable o : Object | Patterns.cs:90:22:90:22 | access to local variable o | provenance | | +| Patterns.cs:88:62:88:62 | access to local variable o : Object | Patterns.cs:90:22:90:22 | access to local variable o | provenance | | | Patterns.cs:97:13:97:13 | access to local variable s : String | Patterns.cs:98:34:98:34 | access to local variable s : String | provenance | | | Patterns.cs:97:13:97:13 | access to local variable s : String | Patterns.cs:98:34:98:34 | access to local variable s : String | provenance | | | Patterns.cs:97:17:97:33 | call to method Source : String | Patterns.cs:97:13:97:13 | access to local variable s : String | provenance | | @@ -150,8 +166,10 @@ edges | Patterns.cs:98:24:98:36 | { ..., ... } : C2 [field Field] : String | Patterns.cs:98:13:98:13 | access to local variable c : C2 [field Field] : String | provenance | | | Patterns.cs:98:34:98:34 | access to local variable s : String | Patterns.cs:98:24:98:36 | { ..., ... } : C2 [field Field] : String | provenance | | | Patterns.cs:98:34:98:34 | access to local variable s : String | Patterns.cs:98:24:98:36 | { ..., ... } : C2 [field Field] : String | provenance | | -| Patterns.cs:99:18:99:39 | { ... } : C2 [field Field] : String | Patterns.cs:101:18:101:18 | access to local variable p | provenance | | -| Patterns.cs:99:18:99:39 | { ... } : C2 [field Field] : String | Patterns.cs:101:18:101:18 | access to local variable p | provenance | | +| Patterns.cs:99:18:99:39 | { ... } : C2 [field Field] : String | Patterns.cs:99:37:99:37 | access to local variable p : String | provenance | | +| Patterns.cs:99:18:99:39 | { ... } : C2 [field Field] : String | Patterns.cs:99:37:99:37 | access to local variable p : String | provenance | | +| Patterns.cs:99:37:99:37 | access to local variable p : String | Patterns.cs:101:18:101:18 | access to local variable p | provenance | | +| Patterns.cs:99:37:99:37 | access to local variable p : String | Patterns.cs:101:18:101:18 | access to local variable p | provenance | | nodes | Patterns.cs:3:21:3:31 | this [Return] : RecordClass [property Prop] : Object | semmle.label | this [Return] : RecordClass [property Prop] : Object | | Patterns.cs:3:21:3:31 | this [Return] : RecordClass [property Prop] : Object | semmle.label | this [Return] : RecordClass [property Prop] : Object | @@ -173,6 +191,8 @@ nodes | Patterns.cs:22:33:22:33 | access to local variable o : Object | semmle.label | access to local variable o : Object | | Patterns.cs:23:18:23:47 | { ... } : RecordClass [property Prop] : Object | semmle.label | { ... } : RecordClass [property Prop] : Object | | Patterns.cs:23:18:23:47 | { ... } : RecordClass [property Prop] : Object | semmle.label | { ... } : RecordClass [property Prop] : Object | +| Patterns.cs:23:45:23:45 | access to local variable p : Object | semmle.label | access to local variable p : Object | +| Patterns.cs:23:45:23:45 | access to local variable p : Object | semmle.label | access to local variable p : Object | | Patterns.cs:25:18:25:18 | access to local variable p | semmle.label | access to local variable p | | Patterns.cs:25:18:25:18 | access to local variable p | semmle.label | access to local variable p | | Patterns.cs:31:13:31:13 | access to local variable o : Object | semmle.label | access to local variable o : Object | @@ -187,6 +207,8 @@ nodes | Patterns.cs:32:33:32:33 | access to local variable o : Object | semmle.label | access to local variable o : Object | | Patterns.cs:35:18:35:47 | { ... } : RecordClass [property Prop] : Object | semmle.label | { ... } : RecordClass [property Prop] : Object | | Patterns.cs:35:18:35:47 | { ... } : RecordClass [property Prop] : Object | semmle.label | { ... } : RecordClass [property Prop] : Object | +| Patterns.cs:35:45:35:45 | access to local variable p : Object | semmle.label | access to local variable p : Object | +| Patterns.cs:35:45:35:45 | access to local variable p : Object | semmle.label | access to local variable p : Object | | Patterns.cs:36:22:36:22 | access to local variable p | semmle.label | access to local variable p | | Patterns.cs:36:22:36:22 | access to local variable p | semmle.label | access to local variable p | | Patterns.cs:43:13:43:13 | access to local variable o : Object | semmle.label | access to local variable o : Object | @@ -205,6 +227,8 @@ nodes | Patterns.cs:45:18:45:54 | { ... } : Nested [property Record, property Prop] : Object | semmle.label | { ... } : Nested [property Record, property Prop] : Object | | Patterns.cs:45:35:45:52 | { ... } : RecordClass [property Prop] : Object | semmle.label | { ... } : RecordClass [property Prop] : Object | | Patterns.cs:45:35:45:52 | { ... } : RecordClass [property Prop] : Object | semmle.label | { ... } : RecordClass [property Prop] : Object | +| Patterns.cs:45:50:45:50 | access to local variable p : Object | semmle.label | access to local variable p : Object | +| Patterns.cs:45:50:45:50 | access to local variable p : Object | semmle.label | access to local variable p : Object | | Patterns.cs:47:18:47:18 | access to local variable p | semmle.label | access to local variable p | | Patterns.cs:47:18:47:18 | access to local variable p | semmle.label | access to local variable p | | Patterns.cs:53:13:53:13 | access to local variable o : Object | semmle.label | access to local variable o : Object | @@ -223,6 +247,8 @@ nodes | Patterns.cs:55:18:55:49 | { ... } : Nested [property Record, property Prop] : Object | semmle.label | { ... } : Nested [property Record, property Prop] : Object | | Patterns.cs:55:27:55:32 | { ... } : null [property Prop] : Object | semmle.label | { ... } : null [property Prop] : Object | | Patterns.cs:55:27:55:32 | { ... } : null [property Prop] : Object | semmle.label | { ... } : null [property Prop] : Object | +| Patterns.cs:55:47:55:47 | access to local variable p : Object | semmle.label | access to local variable p : Object | +| Patterns.cs:55:47:55:47 | access to local variable p : Object | semmle.label | access to local variable p : Object | | Patterns.cs:57:18:57:18 | access to local variable p | semmle.label | access to local variable p | | Patterns.cs:57:18:57:18 | access to local variable p | semmle.label | access to local variable p | | Patterns.cs:63:13:63:13 | access to local variable o : Object | semmle.label | access to local variable o : Object | @@ -237,6 +263,8 @@ nodes | Patterns.cs:64:41:64:41 | access to local variable o : Object | semmle.label | access to local variable o : Object | | Patterns.cs:65:18:65:46 | { ... } : C1 [property Prop] : Object | semmle.label | { ... } : C1 [property Prop] : Object | | Patterns.cs:65:18:65:46 | { ... } : C1 [property Prop] : Object | semmle.label | { ... } : C1 [property Prop] : Object | +| Patterns.cs:65:44:65:44 | access to local variable p : Object | semmle.label | access to local variable p : Object | +| Patterns.cs:65:44:65:44 | access to local variable p : Object | semmle.label | access to local variable p : Object | | Patterns.cs:67:18:67:18 | access to local variable p | semmle.label | access to local variable p | | Patterns.cs:67:18:67:18 | access to local variable p | semmle.label | access to local variable p | | Patterns.cs:73:13:73:13 | access to local variable o : Object | semmle.label | access to local variable o : Object | @@ -253,6 +281,8 @@ nodes | Patterns.cs:74:44:74:44 | access to local variable o : Object | semmle.label | access to local variable o : Object | | Patterns.cs:75:18:75:65 | { ... } : Nested [property Record, property Prop] : Object | semmle.label | { ... } : Nested [property Record, property Prop] : Object | | Patterns.cs:75:18:75:65 | { ... } : Nested [property Record, property Prop] : Object | semmle.label | { ... } : Nested [property Record, property Prop] : Object | +| Patterns.cs:75:63:75:63 | access to local variable r : RecordClass [property Prop] : Object | semmle.label | access to local variable r : RecordClass [property Prop] : Object | +| Patterns.cs:75:63:75:63 | access to local variable r : RecordClass [property Prop] : Object | semmle.label | access to local variable r : RecordClass [property Prop] : Object | | Patterns.cs:77:18:77:18 | access to local variable r : RecordClass [property Prop] : Object | semmle.label | access to local variable r : RecordClass [property Prop] : Object | | Patterns.cs:77:18:77:18 | access to local variable r : RecordClass [property Prop] : Object | semmle.label | access to local variable r : RecordClass [property Prop] : Object | | Patterns.cs:77:18:77:23 | access to property Prop | semmle.label | access to property Prop | @@ -289,6 +319,10 @@ nodes | Patterns.cs:88:19:88:55 | { ... } : Nested [property Record, property Prop] : Object | semmle.label | { ... } : Nested [property Record, property Prop] : Object | | Patterns.cs:88:36:88:53 | { ... } : RecordClass [property Prop] : Object | semmle.label | { ... } : RecordClass [property Prop] : Object | | Patterns.cs:88:36:88:53 | { ... } : RecordClass [property Prop] : Object | semmle.label | { ... } : RecordClass [property Prop] : Object | +| Patterns.cs:88:51:88:51 | access to local variable p : Object | semmle.label | access to local variable p : Object | +| Patterns.cs:88:51:88:51 | access to local variable p : Object | semmle.label | access to local variable p : Object | +| Patterns.cs:88:62:88:62 | access to local variable o : Object | semmle.label | access to local variable o : Object | +| Patterns.cs:88:62:88:62 | access to local variable o : Object | semmle.label | access to local variable o : Object | | Patterns.cs:89:22:89:22 | access to local variable p | semmle.label | access to local variable p | | Patterns.cs:89:22:89:22 | access to local variable p | semmle.label | access to local variable p | | Patterns.cs:90:22:90:22 | access to local variable o | semmle.label | access to local variable o | @@ -305,6 +339,8 @@ nodes | Patterns.cs:98:34:98:34 | access to local variable s : String | semmle.label | access to local variable s : String | | Patterns.cs:99:18:99:39 | { ... } : C2 [field Field] : String | semmle.label | { ... } : C2 [field Field] : String | | Patterns.cs:99:18:99:39 | { ... } : C2 [field Field] : String | semmle.label | { ... } : C2 [field Field] : String | +| Patterns.cs:99:37:99:37 | access to local variable p : String | semmle.label | access to local variable p : String | +| Patterns.cs:99:37:99:37 | access to local variable p : String | semmle.label | access to local variable p : String | | Patterns.cs:101:18:101:18 | access to local variable p | semmle.label | access to local variable p | | Patterns.cs:101:18:101:18 | access to local variable p | semmle.label | access to local variable p | subpaths From 6576471aac8249263d22016c2adc4b6d59ca332c Mon Sep 17 00:00:00 2001 From: Tom Hvitved Date: Fri, 20 Nov 2026 16:15:49 +0100 Subject: [PATCH 2/3] C#: Keep pattern definitions out of jump-to-definition uses Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- csharp/ql/lib/definitions.qll | 1 + .../dataflow/local/DataFlowStep.expected | 16 ++-- .../dataflow/local/TaintTrackingStep.expected | 16 ++-- .../dataflow/tuples/DataFlowStep.expected | 44 ++++----- .../dataflow/tuples/PrintAst.expected | 23 ++++- .../dataflow/tuples/Tuples.expected | 96 ++++++++++++++----- .../dataflow/types/Types.expected | 12 ++- .../definitions/PrintAst.expected | 6 +- 8 files changed, 146 insertions(+), 68 deletions(-) diff --git a/csharp/ql/lib/definitions.qll b/csharp/ql/lib/definitions.qll index d4f2540bbef5..67801e43a3c9 100644 --- a/csharp/ql/lib/definitions.qll +++ b/csharp/ql/lib/definitions.qll @@ -97,6 +97,7 @@ private class AccessUse extends Access, Use { AccessUse() { not this.getTarget().(Parameter).getCallable() instanceof Accessor and not this = any(LocalVariableDeclAndInitExpr d).getLeftOperand() and + not this = any(AssignableDefinitions::PatternDefinition d).getTargetAccess() and not this.isImplicit() and not this instanceof MethodAccess and // handled by `MethodUse` not this instanceof TypeAccess and // handled by `TypeMentionUse` diff --git a/csharp/ql/test/library-tests/dataflow/local/DataFlowStep.expected b/csharp/ql/test/library-tests/dataflow/local/DataFlowStep.expected index 2a88f163a3aa..6033eebaa87b 100644 --- a/csharp/ql/test/library-tests/dataflow/local/DataFlowStep.expected +++ b/csharp/ql/test/library-tests/dataflow/local/DataFlowStep.expected @@ -461,21 +461,21 @@ | LocalDataFlow.cs:285:31:285:38 | access to local variable nonSink0 | LocalDataFlow.cs:285:20:285:38 | ... = ... | | LocalDataFlow.cs:286:15:286:22 | [post] access to local variable nonSink0 | LocalDataFlow.cs:293:13:293:20 | access to local variable nonSink0 | | LocalDataFlow.cs:286:15:286:22 | access to local variable nonSink0 | LocalDataFlow.cs:293:13:293:20 | access to local variable nonSink0 | -| LocalDataFlow.cs:289:13:289:18 | access to local variable sink70 | LocalDataFlow.cs:289:23:289:35 | String sink71 | +| LocalDataFlow.cs:289:13:289:18 | access to local variable sink70 | LocalDataFlow.cs:289:30:289:35 | access to local variable sink71 | | LocalDataFlow.cs:289:13:289:18 | access to local variable sink70 | LocalDataFlow.cs:297:17:297:22 | access to local variable sink70 | | LocalDataFlow.cs:289:23:289:35 | SSA def(sink71) | LocalDataFlow.cs:290:19:290:24 | access to local variable sink71 | -| LocalDataFlow.cs:289:23:289:35 | String sink71 | LocalDataFlow.cs:289:23:289:35 | SSA def(sink71) | -| LocalDataFlow.cs:293:13:293:20 | access to local variable nonSink0 | LocalDataFlow.cs:293:25:293:40 | String nonSink16 | +| LocalDataFlow.cs:289:30:289:35 | access to local variable sink71 | LocalDataFlow.cs:289:23:289:35 | SSA def(sink71) | +| LocalDataFlow.cs:293:13:293:20 | access to local variable nonSink0 | LocalDataFlow.cs:293:32:293:40 | access to local variable nonSink16 | | LocalDataFlow.cs:293:13:293:20 | access to local variable nonSink0 | LocalDataFlow.cs:305:17:305:24 | access to local variable nonSink0 | | LocalDataFlow.cs:293:25:293:40 | SSA def(nonSink16) | LocalDataFlow.cs:294:19:294:27 | access to local variable nonSink16 | -| LocalDataFlow.cs:293:25:293:40 | String nonSink16 | LocalDataFlow.cs:293:25:293:40 | SSA def(nonSink16) | -| LocalDataFlow.cs:297:17:297:22 | access to local variable sink70 | LocalDataFlow.cs:299:18:299:30 | String sink72 | +| LocalDataFlow.cs:293:32:293:40 | access to local variable nonSink16 | LocalDataFlow.cs:293:25:293:40 | SSA def(nonSink16) | +| LocalDataFlow.cs:297:17:297:22 | access to local variable sink70 | LocalDataFlow.cs:299:25:299:30 | access to local variable sink72 | | LocalDataFlow.cs:299:18:299:30 | SSA def(sink72) | LocalDataFlow.cs:300:23:300:28 | access to local variable sink72 | -| LocalDataFlow.cs:299:18:299:30 | String sink72 | LocalDataFlow.cs:299:18:299:30 | SSA def(sink72) | -| LocalDataFlow.cs:305:17:305:24 | access to local variable nonSink0 | LocalDataFlow.cs:307:18:307:33 | String nonSink17 | +| LocalDataFlow.cs:299:25:299:30 | access to local variable sink72 | LocalDataFlow.cs:299:18:299:30 | SSA def(sink72) | +| LocalDataFlow.cs:305:17:305:24 | access to local variable nonSink0 | LocalDataFlow.cs:307:25:307:33 | access to local variable nonSink17 | | LocalDataFlow.cs:305:17:305:24 | access to local variable nonSink0 | LocalDataFlow.cs:313:22:313:29 | access to local variable nonSink0 | | LocalDataFlow.cs:307:18:307:33 | SSA def(nonSink17) | LocalDataFlow.cs:308:23:308:31 | access to local variable nonSink17 | -| LocalDataFlow.cs:307:18:307:33 | String nonSink17 | LocalDataFlow.cs:307:18:307:33 | SSA def(nonSink17) | +| LocalDataFlow.cs:307:25:307:33 | access to local variable nonSink17 | LocalDataFlow.cs:307:18:307:33 | SSA def(nonSink17) | | LocalDataFlow.cs:313:13:313:18 | access to local variable sink73 | LocalDataFlow.cs:313:13:313:38 | SSA def(sink73) | | LocalDataFlow.cs:313:13:313:38 | SSA def(sink73) | LocalDataFlow.cs:315:15:315:20 | access to local variable sink73 | | LocalDataFlow.cs:313:22:313:29 | [input] SSA phi read(sink0) | LocalDataFlow.cs:314:22:314:26 | access to local variable sink0 | diff --git a/csharp/ql/test/library-tests/dataflow/local/TaintTrackingStep.expected b/csharp/ql/test/library-tests/dataflow/local/TaintTrackingStep.expected index 8f059acc6caa..9873d0ace389 100644 --- a/csharp/ql/test/library-tests/dataflow/local/TaintTrackingStep.expected +++ b/csharp/ql/test/library-tests/dataflow/local/TaintTrackingStep.expected @@ -572,21 +572,21 @@ | LocalDataFlow.cs:285:31:285:38 | access to local variable nonSink0 | LocalDataFlow.cs:285:20:285:38 | ... = ... | | LocalDataFlow.cs:286:15:286:22 | [post] access to local variable nonSink0 | LocalDataFlow.cs:293:13:293:20 | access to local variable nonSink0 | | LocalDataFlow.cs:286:15:286:22 | access to local variable nonSink0 | LocalDataFlow.cs:293:13:293:20 | access to local variable nonSink0 | -| LocalDataFlow.cs:289:13:289:18 | access to local variable sink70 | LocalDataFlow.cs:289:23:289:35 | String sink71 | +| LocalDataFlow.cs:289:13:289:18 | access to local variable sink70 | LocalDataFlow.cs:289:30:289:35 | access to local variable sink71 | | LocalDataFlow.cs:289:13:289:18 | access to local variable sink70 | LocalDataFlow.cs:297:17:297:22 | access to local variable sink70 | | LocalDataFlow.cs:289:23:289:35 | SSA def(sink71) | LocalDataFlow.cs:290:19:290:24 | access to local variable sink71 | -| LocalDataFlow.cs:289:23:289:35 | String sink71 | LocalDataFlow.cs:289:23:289:35 | SSA def(sink71) | -| LocalDataFlow.cs:293:13:293:20 | access to local variable nonSink0 | LocalDataFlow.cs:293:25:293:40 | String nonSink16 | +| LocalDataFlow.cs:289:30:289:35 | access to local variable sink71 | LocalDataFlow.cs:289:23:289:35 | SSA def(sink71) | +| LocalDataFlow.cs:293:13:293:20 | access to local variable nonSink0 | LocalDataFlow.cs:293:32:293:40 | access to local variable nonSink16 | | LocalDataFlow.cs:293:13:293:20 | access to local variable nonSink0 | LocalDataFlow.cs:305:17:305:24 | access to local variable nonSink0 | | LocalDataFlow.cs:293:25:293:40 | SSA def(nonSink16) | LocalDataFlow.cs:294:19:294:27 | access to local variable nonSink16 | -| LocalDataFlow.cs:293:25:293:40 | String nonSink16 | LocalDataFlow.cs:293:25:293:40 | SSA def(nonSink16) | -| LocalDataFlow.cs:297:17:297:22 | access to local variable sink70 | LocalDataFlow.cs:299:18:299:30 | String sink72 | +| LocalDataFlow.cs:293:32:293:40 | access to local variable nonSink16 | LocalDataFlow.cs:293:25:293:40 | SSA def(nonSink16) | +| LocalDataFlow.cs:297:17:297:22 | access to local variable sink70 | LocalDataFlow.cs:299:25:299:30 | access to local variable sink72 | | LocalDataFlow.cs:299:18:299:30 | SSA def(sink72) | LocalDataFlow.cs:300:23:300:28 | access to local variable sink72 | -| LocalDataFlow.cs:299:18:299:30 | String sink72 | LocalDataFlow.cs:299:18:299:30 | SSA def(sink72) | -| LocalDataFlow.cs:305:17:305:24 | access to local variable nonSink0 | LocalDataFlow.cs:307:18:307:33 | String nonSink17 | +| LocalDataFlow.cs:299:25:299:30 | access to local variable sink72 | LocalDataFlow.cs:299:18:299:30 | SSA def(sink72) | +| LocalDataFlow.cs:305:17:305:24 | access to local variable nonSink0 | LocalDataFlow.cs:307:25:307:33 | access to local variable nonSink17 | | LocalDataFlow.cs:305:17:305:24 | access to local variable nonSink0 | LocalDataFlow.cs:313:22:313:29 | access to local variable nonSink0 | | LocalDataFlow.cs:307:18:307:33 | SSA def(nonSink17) | LocalDataFlow.cs:308:23:308:31 | access to local variable nonSink17 | -| LocalDataFlow.cs:307:18:307:33 | String nonSink17 | LocalDataFlow.cs:307:18:307:33 | SSA def(nonSink17) | +| LocalDataFlow.cs:307:25:307:33 | access to local variable nonSink17 | LocalDataFlow.cs:307:18:307:33 | SSA def(nonSink17) | | LocalDataFlow.cs:313:13:313:18 | access to local variable sink73 | LocalDataFlow.cs:313:13:313:38 | SSA def(sink73) | | LocalDataFlow.cs:313:13:313:38 | SSA def(sink73) | LocalDataFlow.cs:315:15:315:20 | access to local variable sink73 | | LocalDataFlow.cs:313:22:313:29 | [input] SSA phi read(sink0) | LocalDataFlow.cs:314:22:314:26 | access to local variable sink0 | diff --git a/csharp/ql/test/library-tests/dataflow/tuples/DataFlowStep.expected b/csharp/ql/test/library-tests/dataflow/tuples/DataFlowStep.expected index 615f40e15850..e60846726d50 100644 --- a/csharp/ql/test/library-tests/dataflow/tuples/DataFlowStep.expected +++ b/csharp/ql/test/library-tests/dataflow/tuples/DataFlowStep.expected @@ -106,16 +106,16 @@ | Tuples.cs:59:13:59:13 | access to local variable x | Tuples.cs:59:13:59:32 | SSA def(x) | | Tuples.cs:59:13:59:32 | SSA def(x) | Tuples.cs:60:17:60:17 | access to local variable x | | Tuples.cs:59:17:59:32 | (..., ...) | Tuples.cs:59:13:59:13 | access to local variable x | -| Tuples.cs:60:17:60:17 | access to local variable x | Tuples.cs:62:18:62:57 | (String,(Int32,String),Int32) t | +| Tuples.cs:60:17:60:17 | access to local variable x | Tuples.cs:62:57:62:57 | access to local variable t | | Tuples.cs:60:17:60:17 | access to local variable x | Tuples.cs:67:18:67:35 | (..., ...) | | Tuples.cs:60:17:60:17 | access to local variable x | Tuples.cs:87:13:87:13 | access to local variable x | -| Tuples.cs:62:18:62:57 | (String,(Int32,String),Int32) t | Tuples.cs:62:18:62:57 | SSA def(t) | | Tuples.cs:62:18:62:57 | SSA def(t) | Tuples.cs:62:64:62:64 | access to local variable t | | Tuples.cs:62:18:62:57 | SSA qualifier def(t.Item1) | Tuples.cs:63:22:63:28 | access to field Item1 | | Tuples.cs:62:18:62:57 | SSA qualifier def(t.Item2) | Tuples.cs:64:22:64:28 | access to field Item2 | | Tuples.cs:62:18:62:57 | SSA qualifier def(t.Item2.Item1) | Tuples.cs:65:22:65:34 | access to field Item1 | | Tuples.cs:62:18:62:57 | SSA qualifier def(t.Item2.Item2) | Tuples.cs:64:22:64:34 | access to field Item2 | | Tuples.cs:62:18:62:57 | SSA qualifier def(t.Item3) | Tuples.cs:62:64:62:70 | access to field Item3 | +| Tuples.cs:62:57:62:57 | access to local variable t | Tuples.cs:62:18:62:57 | SSA def(t) | | Tuples.cs:62:64:62:64 | access to local variable t | Tuples.cs:63:22:63:22 | access to local variable t | | Tuples.cs:63:22:63:22 | [post] access to local variable t | Tuples.cs:64:22:64:22 | access to local variable t | | Tuples.cs:63:22:63:22 | access to local variable t | Tuples.cs:64:22:64:22 | access to local variable t | @@ -125,11 +125,11 @@ | Tuples.cs:64:22:64:28 | access to field Item2 | Tuples.cs:65:22:65:28 | access to field Item2 | | Tuples.cs:65:22:65:34 | access to field Item1 | Tuples.cs:65:22:65:34 | (...) ... | | Tuples.cs:67:23:67:23 | SSA def(a) | Tuples.cs:68:22:68:22 | access to local variable a | -| Tuples.cs:67:23:67:23 | String a | Tuples.cs:67:23:67:23 | SSA def(a) | -| Tuples.cs:67:27:67:27 | Int32 b | Tuples.cs:67:27:67:27 | SSA def(b) | +| Tuples.cs:67:23:67:23 | access to local variable a | Tuples.cs:67:23:67:23 | SSA def(a) | | Tuples.cs:67:27:67:27 | SSA def(b) | Tuples.cs:70:22:70:22 | access to local variable b | +| Tuples.cs:67:27:67:27 | access to local variable b | Tuples.cs:67:27:67:27 | SSA def(b) | | Tuples.cs:67:30:67:30 | SSA def(c) | Tuples.cs:69:22:69:22 | access to local variable c | -| Tuples.cs:67:30:67:30 | String c | Tuples.cs:67:30:67:30 | SSA def(c) | +| Tuples.cs:67:30:67:30 | access to local variable c | Tuples.cs:67:30:67:30 | SSA def(c) | | Tuples.cs:70:22:70:22 | access to local variable b | Tuples.cs:70:22:70:22 | (...) ... | | Tuples.cs:74:13:74:14 | access to local variable o3 | Tuples.cs:74:13:74:34 | SSA def(o3) | | Tuples.cs:74:13:74:34 | SSA def(o3) | Tuples.cs:78:51:78:52 | access to local variable o3 | @@ -146,11 +146,11 @@ | Tuples.cs:76:17:76:17 | access to local variable y | Tuples.cs:78:18:78:39 | { ... } | | Tuples.cs:76:17:76:17 | access to local variable y | Tuples.cs:79:22:79:22 | access to local variable y | | Tuples.cs:78:19:78:23 | SSA def(a) | Tuples.cs:78:46:78:46 | access to local variable a | -| Tuples.cs:78:19:78:23 | String a | Tuples.cs:78:19:78:23 | SSA def(a) | -| Tuples.cs:78:31:78:31 | Int32 b | Tuples.cs:78:31:78:31 | SSA def(b) | +| Tuples.cs:78:23:78:23 | access to local variable a | Tuples.cs:78:19:78:23 | SSA def(a) | | Tuples.cs:78:31:78:31 | SSA def(b) | Tuples.cs:83:22:83:22 | access to local variable b | +| Tuples.cs:78:31:78:31 | access to local variable b | Tuples.cs:78:31:78:31 | SSA def(b) | | Tuples.cs:78:34:78:34 | SSA def(c) | Tuples.cs:81:22:81:22 | access to local variable c | -| Tuples.cs:78:34:78:34 | String c | Tuples.cs:78:34:78:34 | SSA def(c) | +| Tuples.cs:78:34:78:34 | access to local variable c | Tuples.cs:78:34:78:34 | SSA def(c) | | Tuples.cs:79:22:79:22 | [post] access to local variable y | Tuples.cs:80:22:80:22 | access to local variable y | | Tuples.cs:79:22:79:22 | access to local variable y | Tuples.cs:80:22:80:22 | access to local variable y | | Tuples.cs:80:22:80:22 | [post] access to local variable y | Tuples.cs:82:22:82:22 | access to local variable y | @@ -161,11 +161,11 @@ | Tuples.cs:83:22:83:22 | access to local variable b | Tuples.cs:83:22:83:22 | (...) ... | | Tuples.cs:87:13:87:13 | access to local variable x | Tuples.cs:87:18:87:35 | (..., ...) | | Tuples.cs:87:23:87:23 | SSA def(p) | Tuples.cs:89:18:89:18 | access to local variable p | -| Tuples.cs:87:23:87:23 | String p | Tuples.cs:87:23:87:23 | SSA def(p) | -| Tuples.cs:87:27:87:27 | Int32 q | Tuples.cs:87:27:87:27 | SSA def(q) | +| Tuples.cs:87:23:87:23 | access to local variable p | Tuples.cs:87:23:87:23 | SSA def(p) | | Tuples.cs:87:27:87:27 | SSA def(q) | Tuples.cs:91:18:91:18 | access to local variable q | +| Tuples.cs:87:27:87:27 | access to local variable q | Tuples.cs:87:27:87:27 | SSA def(q) | | Tuples.cs:87:30:87:30 | SSA def(r) | Tuples.cs:90:18:90:18 | access to local variable r | -| Tuples.cs:87:30:87:30 | String r | Tuples.cs:87:30:87:30 | SSA def(r) | +| Tuples.cs:87:30:87:30 | access to local variable r | Tuples.cs:87:30:87:30 | SSA def(r) | | Tuples.cs:91:18:91:18 | access to local variable q | Tuples.cs:91:18:91:18 | (...) ... | | Tuples.cs:95:12:95:13 | this | Tuples.cs:95:12:95:13 | this access | | Tuples.cs:95:12:95:13 | this | Tuples.cs:95:22:95:22 | this | @@ -192,9 +192,9 @@ | Tuples.cs:105:14:105:14 | access to local variable b | Tuples.cs:105:14:105:14 | (...) ... | | Tuples.cs:107:17:107:17 | access to local variable r | Tuples.cs:109:18:109:27 | (..., ...) | | Tuples.cs:109:23:109:23 | SSA def(x) | Tuples.cs:110:22:110:22 | access to local variable x | -| Tuples.cs:109:23:109:23 | String x | Tuples.cs:109:23:109:23 | SSA def(x) | -| Tuples.cs:109:26:109:26 | Int32 y | Tuples.cs:109:26:109:26 | SSA def(y) | +| Tuples.cs:109:23:109:23 | access to local variable x | Tuples.cs:109:23:109:23 | SSA def(x) | | Tuples.cs:109:26:109:26 | SSA def(y) | Tuples.cs:111:22:111:22 | access to local variable y | +| Tuples.cs:109:26:109:26 | access to local variable y | Tuples.cs:109:26:109:26 | SSA def(y) | | Tuples.cs:111:22:111:22 | access to local variable y | Tuples.cs:111:22:111:22 | (...) ... | | Tuples.cs:118:13:118:13 | access to local variable o | Tuples.cs:118:13:118:33 | SSA def(o) | | Tuples.cs:118:13:118:33 | SSA def(o) | Tuples.cs:121:28:121:28 | access to local variable o | @@ -240,11 +240,11 @@ | Tuples.cs:141:17:141:32 | (..., ...) | Tuples.cs:141:13:141:13 | access to local variable x | | Tuples.cs:142:17:142:17 | access to local variable x | Tuples.cs:144:18:144:46 | { ... } | | Tuples.cs:144:19:144:24 | SSA def(a1) | Tuples.cs:145:22:145:23 | access to local variable a1 | -| Tuples.cs:144:19:144:24 | String a1 | Tuples.cs:144:19:144:24 | SSA def(a1) | -| Tuples.cs:144:28:144:33 | Int32 b1 | Tuples.cs:144:28:144:33 | SSA def(b1) | +| Tuples.cs:144:23:144:24 | access to local variable a1 | Tuples.cs:144:19:144:24 | SSA def(a1) | | Tuples.cs:144:28:144:33 | SSA def(b1) | Tuples.cs:147:22:147:23 | access to local variable b1 | +| Tuples.cs:144:32:144:33 | access to local variable b1 | Tuples.cs:144:28:144:33 | SSA def(b1) | | Tuples.cs:144:36:144:41 | SSA def(c1) | Tuples.cs:146:22:146:23 | access to local variable c1 | -| Tuples.cs:144:36:144:41 | String c1 | Tuples.cs:144:36:144:41 | SSA def(c1) | +| Tuples.cs:144:40:144:41 | access to local variable c1 | Tuples.cs:144:36:144:41 | SSA def(c1) | | Tuples.cs:147:22:147:23 | access to local variable b1 | Tuples.cs:147:22:147:23 | (...) ... | | Tuples.cs:151:13:151:14 | access to local variable o3 | Tuples.cs:151:13:151:35 | SSA def(o3) | | Tuples.cs:151:13:151:35 | SSA def(o3) | Tuples.cs:153:18:153:19 | access to local variable o3 | @@ -259,11 +259,11 @@ | Tuples.cs:153:17:153:32 | (..., ...) | Tuples.cs:153:13:153:13 | access to local variable y | | Tuples.cs:154:13:154:13 | access to local variable y | Tuples.cs:154:18:154:42 | { ... } | | Tuples.cs:154:19:154:24 | SSA def(a2) | Tuples.cs:156:18:156:19 | access to local variable a2 | -| Tuples.cs:154:19:154:24 | String a2 | Tuples.cs:154:19:154:24 | SSA def(a2) | -| Tuples.cs:154:32:154:33 | Int32 b2 | Tuples.cs:154:32:154:33 | SSA def(b2) | +| Tuples.cs:154:23:154:24 | access to local variable a2 | Tuples.cs:154:19:154:24 | SSA def(a2) | | Tuples.cs:154:32:154:33 | SSA def(b2) | Tuples.cs:158:18:158:19 | access to local variable b2 | +| Tuples.cs:154:32:154:33 | access to local variable b2 | Tuples.cs:154:32:154:33 | SSA def(b2) | | Tuples.cs:154:36:154:37 | SSA def(c2) | Tuples.cs:157:18:157:19 | access to local variable c2 | -| Tuples.cs:154:36:154:37 | String c2 | Tuples.cs:154:36:154:37 | SSA def(c2) | +| Tuples.cs:154:36:154:37 | access to local variable c2 | Tuples.cs:154:36:154:37 | SSA def(c2) | | Tuples.cs:158:18:158:19 | access to local variable b2 | Tuples.cs:158:18:158:19 | (...) ... | | Tuples.cs:161:13:161:14 | access to local variable o5 | Tuples.cs:161:13:161:35 | SSA def(o5) | | Tuples.cs:161:13:161:35 | SSA def(o5) | Tuples.cs:163:18:163:19 | access to local variable o5 | @@ -278,11 +278,11 @@ | Tuples.cs:163:17:163:32 | (..., ...) | Tuples.cs:163:13:163:13 | access to local variable z | | Tuples.cs:164:13:164:13 | access to local variable z | Tuples.cs:164:18:164:47 | { ... } | | Tuples.cs:164:19:164:24 | SSA def(a3) | Tuples.cs:166:18:166:19 | access to local variable a3 | -| Tuples.cs:164:19:164:24 | String a3 | Tuples.cs:164:19:164:24 | SSA def(a3) | -| Tuples.cs:164:27:164:43 | (Int32,String) t | Tuples.cs:164:27:164:43 | SSA def(t) | +| Tuples.cs:164:23:164:24 | access to local variable a3 | Tuples.cs:164:19:164:24 | SSA def(a3) | | Tuples.cs:164:27:164:43 | SSA def(t) | Tuples.cs:167:18:167:18 | access to local variable t | | Tuples.cs:164:27:164:43 | SSA qualifier def(t.Item2) | Tuples.cs:167:18:167:24 | access to field Item2 | -| Tuples.cs:164:28:164:33 | Int32 b3 | Tuples.cs:164:28:164:33 | SSA def(b3) | | Tuples.cs:164:28:164:33 | SSA def(b3) | Tuples.cs:168:18:168:19 | access to local variable b3 | +| Tuples.cs:164:32:164:33 | access to local variable b3 | Tuples.cs:164:28:164:33 | SSA def(b3) | +| Tuples.cs:164:43:164:43 | access to local variable t | Tuples.cs:164:27:164:43 | SSA def(t) | | Tuples.cs:168:18:168:19 | access to local variable b3 | Tuples.cs:168:18:168:19 | (...) ... | | Tuples.cs:179:18:179:31 | this | Tuples.cs:179:18:179:31 | this access | diff --git a/csharp/ql/test/library-tests/dataflow/tuples/PrintAst.expected b/csharp/ql/test/library-tests/dataflow/tuples/PrintAst.expected index 9e9edd2f5875..03ce7e93910e 100644 --- a/csharp/ql/test/library-tests/dataflow/tuples/PrintAst.expected +++ b/csharp/ql/test/library-tests/dataflow/tuples/PrintAst.expected @@ -235,12 +235,13 @@ Tuples.cs: # 60| 0: [LocalVariableAccess] access to local variable x # 62| 0: [CaseStmt] case ...: # 62| 0: [VariablePatternExpr] (String,(Int32,String),Int32) t -# 62| 0: [TypeMention] (string, (int, string), int) +# 62| -1: [TypeMention] (string, (int, string), int) # 62| 1: [TypeMention] string # 62| 2: [TypeMention] (int, string) # 62| 1: [TypeMention] int # 62| 2: [TypeMention] string # 62| 3: [TypeMention] int +# 62| 0: [LocalVariableAccess] access to local variable t # 62| 1: [GTExpr] ... > ... # 62| 0: [FieldAccess] access to field Item3 # 62| -1: [LocalVariableAccess] access to local variable t @@ -264,9 +265,12 @@ Tuples.cs: # 67| 5: [CaseStmt] case ...: # 67| 0: [TuplePatternExpr] (..., ...) # 67| 0: [VariablePatternExpr] String a +# 67| 0: [LocalVariableAccess] access to local variable a # 67| 1: [TuplePatternExpr] (..., ...) # 67| 0: [VariablePatternExpr] Int32 b +# 67| 0: [LocalVariableAccess] access to local variable b # 67| 1: [VariablePatternExpr] String c +# 67| 0: [LocalVariableAccess] access to local variable c # 67| 2: [DiscardPatternExpr] _ # 68| 6: [ExprStmt] ...; # 68| 0: [MethodCall] call to method Sink @@ -302,9 +306,12 @@ Tuples.cs: # 78| 0: [RecursivePatternExpr] { ... } # 78| 2: [PositionalPatternExpr] ( ... ) # 78| 0: [VariablePatternExpr] String a +# 78| 0: [LocalVariableAccess] access to local variable a # 78| 1: [TuplePatternExpr] (..., ...) # 78| 0: [VariablePatternExpr] Int32 b +# 78| 0: [LocalVariableAccess] access to local variable b # 78| 1: [VariablePatternExpr] String c +# 78| 0: [LocalVariableAccess] access to local variable c # 78| 2: [DiscardPatternExpr] _ # 78| 1: [EQExpr] ... == ... # 78| 0: [LocalVariableAccess] access to local variable a @@ -337,9 +344,12 @@ Tuples.cs: # 87| 0: [LocalVariableAccess] access to local variable x # 87| 1: [TuplePatternExpr] (..., ...) # 87| 0: [VariablePatternExpr] String p +# 87| 0: [LocalVariableAccess] access to local variable p # 87| 1: [TuplePatternExpr] (..., ...) # 87| 0: [VariablePatternExpr] Int32 q +# 87| 0: [LocalVariableAccess] access to local variable q # 87| 1: [VariablePatternExpr] String r +# 87| 0: [LocalVariableAccess] access to local variable r # 87| 2: [DiscardPatternExpr] _ # 88| 1: [BlockStmt] {...} # 89| 0: [ExprStmt] ...; @@ -419,7 +429,9 @@ Tuples.cs: # 109| 0: [CaseStmt] case ...: # 109| 0: [TuplePatternExpr] (..., ...) # 109| 0: [VariablePatternExpr] String x +# 109| 0: [LocalVariableAccess] access to local variable x # 109| 1: [VariablePatternExpr] Int32 y +# 109| 0: [LocalVariableAccess] access to local variable y # 110| 1: [ExprStmt] ...; # 110| 0: [MethodCall] call to method Sink # 110| 0: [LocalVariableAccess] access to local variable x @@ -537,10 +549,13 @@ Tuples.cs: # 144| 0: [RecursivePatternExpr] { ... } # 144| 2: [PositionalPatternExpr] ( ... ) # 144| 0: [VariablePatternExpr] String a1 +# 144| 0: [LocalVariableAccess] access to local variable a1 # 144| 1: [RecursivePatternExpr] { ... } # 144| 2: [PositionalPatternExpr] ( ... ) # 144| 0: [VariablePatternExpr] Int32 b1 +# 144| 0: [LocalVariableAccess] access to local variable b1 # 144| 1: [VariablePatternExpr] String c1 +# 144| 0: [LocalVariableAccess] access to local variable c1 # 144| 2: [DiscardPatternExpr] _ # 145| 1: [ExprStmt] ...; # 145| 0: [MethodCall] call to method Sink @@ -583,9 +598,12 @@ Tuples.cs: # 154| 1: [RecursivePatternExpr] { ... } # 154| 2: [PositionalPatternExpr] ( ... ) # 154| 0: [VariablePatternExpr] String a2 +# 154| 0: [LocalVariableAccess] access to local variable a2 # 154| 1: [TuplePatternExpr] (..., ...) # 154| 0: [VariablePatternExpr] Int32 b2 +# 154| 0: [LocalVariableAccess] access to local variable b2 # 154| 1: [VariablePatternExpr] String c2 +# 154| 0: [LocalVariableAccess] access to local variable c2 # 154| 2: [DiscardPatternExpr] _ # 155| 1: [BlockStmt] {...} # 156| 0: [ExprStmt] ...; @@ -628,10 +646,13 @@ Tuples.cs: # 164| 1: [RecursivePatternExpr] { ... } # 164| 2: [PositionalPatternExpr] ( ... ) # 164| 0: [VariablePatternExpr] String a3 +# 164| 0: [LocalVariableAccess] access to local variable a3 # 164| 1: [RecursivePatternExpr] { ... } # 164| 0: [VariablePatternExpr] (Int32,String) t +# 164| 0: [LocalVariableAccess] access to local variable t # 164| 2: [PositionalPatternExpr] ( ... ) # 164| 0: [VariablePatternExpr] Int32 b3 +# 164| 0: [LocalVariableAccess] access to local variable b3 # 164| 1: [DiscardPatternExpr] _ # 164| 2: [DiscardPatternExpr] _ # 165| 1: [BlockStmt] {...} diff --git a/csharp/ql/test/library-tests/dataflow/tuples/Tuples.expected b/csharp/ql/test/library-tests/dataflow/tuples/Tuples.expected index e3b79c4c0eb9..57aa4b763c2e 100644 --- a/csharp/ql/test/library-tests/dataflow/tuples/Tuples.expected +++ b/csharp/ql/test/library-tests/dataflow/tuples/Tuples.expected @@ -112,14 +112,14 @@ edges | Tuples.cs:58:13:58:14 | access to local variable o2 : String | Tuples.cs:59:26:59:27 | access to local variable o2 : String | provenance | | | Tuples.cs:58:18:58:34 | call to method Source : String | Tuples.cs:58:13:58:14 | access to local variable o2 : String | provenance | | | Tuples.cs:58:18:58:34 | call to method Source : String | Tuples.cs:58:13:58:14 | access to local variable o2 : String | provenance | | -| Tuples.cs:59:13:59:13 | access to local variable x : ValueTuple,Int32> [field Item1] : String | Tuples.cs:63:22:63:22 | access to local variable t : ValueTuple,Int32> [field Item1] : String | provenance | | -| Tuples.cs:59:13:59:13 | access to local variable x : ValueTuple,Int32> [field Item1] : String | Tuples.cs:63:22:63:22 | access to local variable t : ValueTuple,Int32> [field Item1] : String | provenance | | +| Tuples.cs:59:13:59:13 | access to local variable x : ValueTuple,Int32> [field Item1] : String | Tuples.cs:62:57:62:57 | access to local variable t : ValueTuple,Int32> [field Item1] : String | provenance | | +| Tuples.cs:59:13:59:13 | access to local variable x : ValueTuple,Int32> [field Item1] : String | Tuples.cs:62:57:62:57 | access to local variable t : ValueTuple,Int32> [field Item1] : String | provenance | | | Tuples.cs:59:13:59:13 | access to local variable x : ValueTuple,Int32> [field Item1] : String | Tuples.cs:67:18:67:35 | (..., ...) : ValueTuple,Int32> [field Item1] : String | provenance | | | Tuples.cs:59:13:59:13 | access to local variable x : ValueTuple,Int32> [field Item1] : String | Tuples.cs:67:18:67:35 | (..., ...) : ValueTuple,Int32> [field Item1] : String | provenance | | | Tuples.cs:59:13:59:13 | access to local variable x : ValueTuple,Int32> [field Item1] : String | Tuples.cs:87:18:87:35 | (..., ...) : ValueTuple,Int32> [field Item1] : String | provenance | | | Tuples.cs:59:13:59:13 | access to local variable x : ValueTuple,Int32> [field Item1] : String | Tuples.cs:87:18:87:35 | (..., ...) : ValueTuple,Int32> [field Item1] : String | provenance | | -| Tuples.cs:59:13:59:13 | access to local variable x : ValueTuple,Int32> [field Item2, field Item2] : String | Tuples.cs:64:22:64:22 | access to local variable t : ValueTuple,Int32> [field Item2, field Item2] : String | provenance | | -| Tuples.cs:59:13:59:13 | access to local variable x : ValueTuple,Int32> [field Item2, field Item2] : String | Tuples.cs:64:22:64:22 | access to local variable t : ValueTuple,Int32> [field Item2, field Item2] : String | provenance | | +| Tuples.cs:59:13:59:13 | access to local variable x : ValueTuple,Int32> [field Item2, field Item2] : String | Tuples.cs:62:57:62:57 | access to local variable t : ValueTuple,Int32> [field Item2, field Item2] : String | provenance | | +| Tuples.cs:59:13:59:13 | access to local variable x : ValueTuple,Int32> [field Item2, field Item2] : String | Tuples.cs:62:57:62:57 | access to local variable t : ValueTuple,Int32> [field Item2, field Item2] : String | provenance | | | Tuples.cs:59:13:59:13 | access to local variable x : ValueTuple,Int32> [field Item2, field Item2] : String | Tuples.cs:67:18:67:35 | (..., ...) : ValueTuple,Int32> [field Item2, field Item2] : String | provenance | | | Tuples.cs:59:13:59:13 | access to local variable x : ValueTuple,Int32> [field Item2, field Item2] : String | Tuples.cs:67:18:67:35 | (..., ...) : ValueTuple,Int32> [field Item2, field Item2] : String | provenance | | | Tuples.cs:59:13:59:13 | access to local variable x : ValueTuple,Int32> [field Item2, field Item2] : String | Tuples.cs:87:18:87:35 | (..., ...) : ValueTuple,Int32> [field Item2, field Item2] : String | provenance | | @@ -134,24 +134,36 @@ edges | Tuples.cs:59:22:59:28 | (..., ...) : ValueTuple [field Item2] : String | Tuples.cs:59:17:59:32 | (..., ...) : ValueTuple,Int32> [field Item2, field Item2] : String | provenance | | | Tuples.cs:59:26:59:27 | access to local variable o2 : String | Tuples.cs:59:22:59:28 | (..., ...) : ValueTuple [field Item2] : String | provenance | | | Tuples.cs:59:26:59:27 | access to local variable o2 : String | Tuples.cs:59:22:59:28 | (..., ...) : ValueTuple [field Item2] : String | provenance | | +| Tuples.cs:62:57:62:57 | access to local variable t : ValueTuple,Int32> [field Item1] : String | Tuples.cs:63:22:63:22 | access to local variable t : ValueTuple,Int32> [field Item1] : String | provenance | | +| Tuples.cs:62:57:62:57 | access to local variable t : ValueTuple,Int32> [field Item1] : String | Tuples.cs:63:22:63:22 | access to local variable t : ValueTuple,Int32> [field Item1] : String | provenance | | +| Tuples.cs:62:57:62:57 | access to local variable t : ValueTuple,Int32> [field Item2, field Item2] : String | Tuples.cs:64:22:64:22 | access to local variable t : ValueTuple,Int32> [field Item2, field Item2] : String | provenance | | +| Tuples.cs:62:57:62:57 | access to local variable t : ValueTuple,Int32> [field Item2, field Item2] : String | Tuples.cs:64:22:64:22 | access to local variable t : ValueTuple,Int32> [field Item2, field Item2] : String | provenance | | | Tuples.cs:63:22:63:22 | access to local variable t : ValueTuple,Int32> [field Item1] : String | Tuples.cs:63:22:63:28 | access to field Item1 | provenance | | | Tuples.cs:63:22:63:22 | access to local variable t : ValueTuple,Int32> [field Item1] : String | Tuples.cs:63:22:63:28 | access to field Item1 | provenance | | | Tuples.cs:64:22:64:22 | access to local variable t : ValueTuple,Int32> [field Item2, field Item2] : String | Tuples.cs:64:22:64:28 | access to field Item2 : ValueTuple [field Item2] : String | provenance | | | Tuples.cs:64:22:64:22 | access to local variable t : ValueTuple,Int32> [field Item2, field Item2] : String | Tuples.cs:64:22:64:28 | access to field Item2 : ValueTuple [field Item2] : String | provenance | | | Tuples.cs:64:22:64:28 | access to field Item2 : ValueTuple [field Item2] : String | Tuples.cs:64:22:64:34 | access to field Item2 | provenance | | | Tuples.cs:64:22:64:28 | access to field Item2 : ValueTuple [field Item2] : String | Tuples.cs:64:22:64:34 | access to field Item2 | provenance | | -| Tuples.cs:67:18:67:35 | (..., ...) : ValueTuple [field Item2] : String | Tuples.cs:69:22:69:22 | access to local variable c | provenance | | -| Tuples.cs:67:18:67:35 | (..., ...) : ValueTuple [field Item2] : String | Tuples.cs:69:22:69:22 | access to local variable c | provenance | | -| Tuples.cs:67:18:67:35 | (..., ...) : ValueTuple,Int32> [field Item1] : String | Tuples.cs:68:22:68:22 | access to local variable a | provenance | | -| Tuples.cs:67:18:67:35 | (..., ...) : ValueTuple,Int32> [field Item1] : String | Tuples.cs:68:22:68:22 | access to local variable a | provenance | | +| Tuples.cs:67:18:67:35 | (..., ...) : ValueTuple [field Item2] : String | Tuples.cs:67:30:67:30 | access to local variable c : String | provenance | | +| Tuples.cs:67:18:67:35 | (..., ...) : ValueTuple [field Item2] : String | Tuples.cs:67:30:67:30 | access to local variable c : String | provenance | | +| Tuples.cs:67:18:67:35 | (..., ...) : ValueTuple,Int32> [field Item1] : String | Tuples.cs:67:23:67:23 | access to local variable a : String | provenance | | +| Tuples.cs:67:18:67:35 | (..., ...) : ValueTuple,Int32> [field Item1] : String | Tuples.cs:67:23:67:23 | access to local variable a : String | provenance | | | Tuples.cs:67:18:67:35 | (..., ...) : ValueTuple,Int32> [field Item2, field Item2] : String | Tuples.cs:67:18:67:35 | (..., ...) : ValueTuple [field Item2] : String | provenance | | | Tuples.cs:67:18:67:35 | (..., ...) : ValueTuple,Int32> [field Item2, field Item2] : String | Tuples.cs:67:18:67:35 | (..., ...) : ValueTuple [field Item2] : String | provenance | | -| Tuples.cs:87:18:87:35 | (..., ...) : ValueTuple [field Item2] : String | Tuples.cs:90:18:90:18 | access to local variable r | provenance | | -| Tuples.cs:87:18:87:35 | (..., ...) : ValueTuple [field Item2] : String | Tuples.cs:90:18:90:18 | access to local variable r | provenance | | -| Tuples.cs:87:18:87:35 | (..., ...) : ValueTuple,Int32> [field Item1] : String | Tuples.cs:89:18:89:18 | access to local variable p | provenance | | -| Tuples.cs:87:18:87:35 | (..., ...) : ValueTuple,Int32> [field Item1] : String | Tuples.cs:89:18:89:18 | access to local variable p | provenance | | +| Tuples.cs:67:23:67:23 | access to local variable a : String | Tuples.cs:68:22:68:22 | access to local variable a | provenance | | +| Tuples.cs:67:23:67:23 | access to local variable a : String | Tuples.cs:68:22:68:22 | access to local variable a | provenance | | +| Tuples.cs:67:30:67:30 | access to local variable c : String | Tuples.cs:69:22:69:22 | access to local variable c | provenance | | +| Tuples.cs:67:30:67:30 | access to local variable c : String | Tuples.cs:69:22:69:22 | access to local variable c | provenance | | +| Tuples.cs:87:18:87:35 | (..., ...) : ValueTuple [field Item2] : String | Tuples.cs:87:30:87:30 | access to local variable r : String | provenance | | +| Tuples.cs:87:18:87:35 | (..., ...) : ValueTuple [field Item2] : String | Tuples.cs:87:30:87:30 | access to local variable r : String | provenance | | +| Tuples.cs:87:18:87:35 | (..., ...) : ValueTuple,Int32> [field Item1] : String | Tuples.cs:87:23:87:23 | access to local variable p : String | provenance | | +| Tuples.cs:87:18:87:35 | (..., ...) : ValueTuple,Int32> [field Item1] : String | Tuples.cs:87:23:87:23 | access to local variable p : String | provenance | | | Tuples.cs:87:18:87:35 | (..., ...) : ValueTuple,Int32> [field Item2, field Item2] : String | Tuples.cs:87:18:87:35 | (..., ...) : ValueTuple [field Item2] : String | provenance | | | Tuples.cs:87:18:87:35 | (..., ...) : ValueTuple,Int32> [field Item2, field Item2] : String | Tuples.cs:87:18:87:35 | (..., ...) : ValueTuple [field Item2] : String | provenance | | +| Tuples.cs:87:23:87:23 | access to local variable p : String | Tuples.cs:89:18:89:18 | access to local variable p | provenance | | +| Tuples.cs:87:23:87:23 | access to local variable p : String | Tuples.cs:89:18:89:18 | access to local variable p | provenance | | +| Tuples.cs:87:30:87:30 | access to local variable r : String | Tuples.cs:90:18:90:18 | access to local variable r | provenance | | +| Tuples.cs:87:30:87:30 | access to local variable r : String | Tuples.cs:90:18:90:18 | access to local variable r | provenance | | | Tuples.cs:95:22:95:22 | i : String | Tuples.cs:95:12:95:13 | this [Return] : R1 [property i] : String | provenance | | | Tuples.cs:95:22:95:22 | i : String | Tuples.cs:95:12:95:13 | this [Return] : R1 [property i] : String | provenance | | | Tuples.cs:99:13:99:13 | access to local variable o : String | Tuples.cs:100:24:100:24 | access to local variable o : String | provenance | | @@ -236,12 +248,16 @@ edges | Tuples.cs:141:22:141:28 | (..., ...) : ValueTuple [field Item2] : String | Tuples.cs:141:17:141:32 | (..., ...) : ValueTuple,Int32> [field Item2, field Item2] : String | provenance | | | Tuples.cs:141:26:141:27 | access to local variable o2 : String | Tuples.cs:141:22:141:28 | (..., ...) : ValueTuple [field Item2] : String | provenance | | | Tuples.cs:141:26:141:27 | access to local variable o2 : String | Tuples.cs:141:22:141:28 | (..., ...) : ValueTuple [field Item2] : String | provenance | | -| Tuples.cs:144:18:144:46 | { ... } : ValueTuple,Int32> [field Item1] : String | Tuples.cs:145:22:145:23 | access to local variable a1 | provenance | | -| Tuples.cs:144:18:144:46 | { ... } : ValueTuple,Int32> [field Item1] : String | Tuples.cs:145:22:145:23 | access to local variable a1 | provenance | | +| Tuples.cs:144:18:144:46 | { ... } : ValueTuple,Int32> [field Item1] : String | Tuples.cs:144:23:144:24 | access to local variable a1 : String | provenance | | +| Tuples.cs:144:18:144:46 | { ... } : ValueTuple,Int32> [field Item1] : String | Tuples.cs:144:23:144:24 | access to local variable a1 : String | provenance | | | Tuples.cs:144:18:144:46 | { ... } : ValueTuple,Int32> [field Item2, field Item2] : String | Tuples.cs:144:27:144:42 | { ... } : ValueTuple [field Item2] : String | provenance | | | Tuples.cs:144:18:144:46 | { ... } : ValueTuple,Int32> [field Item2, field Item2] : String | Tuples.cs:144:27:144:42 | { ... } : ValueTuple [field Item2] : String | provenance | | -| Tuples.cs:144:27:144:42 | { ... } : ValueTuple [field Item2] : String | Tuples.cs:146:22:146:23 | access to local variable c1 | provenance | | -| Tuples.cs:144:27:144:42 | { ... } : ValueTuple [field Item2] : String | Tuples.cs:146:22:146:23 | access to local variable c1 | provenance | | +| Tuples.cs:144:23:144:24 | access to local variable a1 : String | Tuples.cs:145:22:145:23 | access to local variable a1 | provenance | | +| Tuples.cs:144:23:144:24 | access to local variable a1 : String | Tuples.cs:145:22:145:23 | access to local variable a1 | provenance | | +| Tuples.cs:144:27:144:42 | { ... } : ValueTuple [field Item2] : String | Tuples.cs:144:40:144:41 | access to local variable c1 : String | provenance | | +| Tuples.cs:144:27:144:42 | { ... } : ValueTuple [field Item2] : String | Tuples.cs:144:40:144:41 | access to local variable c1 : String | provenance | | +| Tuples.cs:144:40:144:41 | access to local variable c1 : String | Tuples.cs:146:22:146:23 | access to local variable c1 | provenance | | +| Tuples.cs:144:40:144:41 | access to local variable c1 : String | Tuples.cs:146:22:146:23 | access to local variable c1 | provenance | | | Tuples.cs:151:13:151:14 | access to local variable o3 : String | Tuples.cs:153:18:153:19 | access to local variable o3 : String | provenance | | | Tuples.cs:151:13:151:14 | access to local variable o3 : String | Tuples.cs:153:18:153:19 | access to local variable o3 : String | provenance | | | Tuples.cs:151:18:151:35 | call to method Source : String | Tuples.cs:151:13:151:14 | access to local variable o3 : String | provenance | | @@ -264,12 +280,16 @@ edges | Tuples.cs:153:22:153:28 | (..., ...) : ValueTuple [field Item2] : String | Tuples.cs:153:17:153:32 | (..., ...) : ValueTuple,Int32> [field Item2, field Item2] : String | provenance | | | Tuples.cs:153:26:153:27 | access to local variable o4 : String | Tuples.cs:153:22:153:28 | (..., ...) : ValueTuple [field Item2] : String | provenance | | | Tuples.cs:153:26:153:27 | access to local variable o4 : String | Tuples.cs:153:22:153:28 | (..., ...) : ValueTuple [field Item2] : String | provenance | | -| Tuples.cs:154:18:154:42 | { ... } : ValueTuple,Int32> [field Item1] : String | Tuples.cs:156:18:156:19 | access to local variable a2 | provenance | | -| Tuples.cs:154:18:154:42 | { ... } : ValueTuple,Int32> [field Item1] : String | Tuples.cs:156:18:156:19 | access to local variable a2 | provenance | | +| Tuples.cs:154:18:154:42 | { ... } : ValueTuple,Int32> [field Item1] : String | Tuples.cs:154:23:154:24 | access to local variable a2 : String | provenance | | +| Tuples.cs:154:18:154:42 | { ... } : ValueTuple,Int32> [field Item1] : String | Tuples.cs:154:23:154:24 | access to local variable a2 : String | provenance | | | Tuples.cs:154:18:154:42 | { ... } : ValueTuple,Int32> [field Item2, field Item2] : String | Tuples.cs:154:27:154:38 | (..., ...) : ValueTuple [field Item2] : String | provenance | | | Tuples.cs:154:18:154:42 | { ... } : ValueTuple,Int32> [field Item2, field Item2] : String | Tuples.cs:154:27:154:38 | (..., ...) : ValueTuple [field Item2] : String | provenance | | -| Tuples.cs:154:27:154:38 | (..., ...) : ValueTuple [field Item2] : String | Tuples.cs:157:18:157:19 | access to local variable c2 | provenance | | -| Tuples.cs:154:27:154:38 | (..., ...) : ValueTuple [field Item2] : String | Tuples.cs:157:18:157:19 | access to local variable c2 | provenance | | +| Tuples.cs:154:23:154:24 | access to local variable a2 : String | Tuples.cs:156:18:156:19 | access to local variable a2 | provenance | | +| Tuples.cs:154:23:154:24 | access to local variable a2 : String | Tuples.cs:156:18:156:19 | access to local variable a2 | provenance | | +| Tuples.cs:154:27:154:38 | (..., ...) : ValueTuple [field Item2] : String | Tuples.cs:154:36:154:37 | access to local variable c2 : String | provenance | | +| Tuples.cs:154:27:154:38 | (..., ...) : ValueTuple [field Item2] : String | Tuples.cs:154:36:154:37 | access to local variable c2 : String | provenance | | +| Tuples.cs:154:36:154:37 | access to local variable c2 : String | Tuples.cs:157:18:157:19 | access to local variable c2 | provenance | | +| Tuples.cs:154:36:154:37 | access to local variable c2 : String | Tuples.cs:157:18:157:19 | access to local variable c2 | provenance | | | Tuples.cs:161:13:161:14 | access to local variable o5 : String | Tuples.cs:163:18:163:19 | access to local variable o5 : String | provenance | | | Tuples.cs:161:13:161:14 | access to local variable o5 : String | Tuples.cs:163:18:163:19 | access to local variable o5 : String | provenance | | | Tuples.cs:161:18:161:35 | call to method Source : String | Tuples.cs:161:13:161:14 | access to local variable o5 : String | provenance | | @@ -292,10 +312,14 @@ edges | Tuples.cs:163:22:163:28 | (..., ...) : ValueTuple [field Item2] : String | Tuples.cs:163:17:163:32 | (..., ...) : ValueTuple,Int32> [field Item2, field Item2] : String | provenance | | | Tuples.cs:163:26:163:27 | access to local variable o6 : String | Tuples.cs:163:22:163:28 | (..., ...) : ValueTuple [field Item2] : String | provenance | | | Tuples.cs:163:26:163:27 | access to local variable o6 : String | Tuples.cs:163:22:163:28 | (..., ...) : ValueTuple [field Item2] : String | provenance | | -| Tuples.cs:164:18:164:47 | { ... } : ValueTuple,Int32> [field Item1] : String | Tuples.cs:166:18:166:19 | access to local variable a3 | provenance | | -| Tuples.cs:164:18:164:47 | { ... } : ValueTuple,Int32> [field Item1] : String | Tuples.cs:166:18:166:19 | access to local variable a3 | provenance | | -| Tuples.cs:164:18:164:47 | { ... } : ValueTuple,Int32> [field Item2, field Item2] : String | Tuples.cs:167:18:167:18 | access to local variable t : ValueTuple [field Item2] : String | provenance | | -| Tuples.cs:164:18:164:47 | { ... } : ValueTuple,Int32> [field Item2, field Item2] : String | Tuples.cs:167:18:167:18 | access to local variable t : ValueTuple [field Item2] : String | provenance | | +| Tuples.cs:164:18:164:47 | { ... } : ValueTuple,Int32> [field Item1] : String | Tuples.cs:164:23:164:24 | access to local variable a3 : String | provenance | | +| Tuples.cs:164:18:164:47 | { ... } : ValueTuple,Int32> [field Item1] : String | Tuples.cs:164:23:164:24 | access to local variable a3 : String | provenance | | +| Tuples.cs:164:18:164:47 | { ... } : ValueTuple,Int32> [field Item2, field Item2] : String | Tuples.cs:164:43:164:43 | access to local variable t : ValueTuple [field Item2] : String | provenance | | +| Tuples.cs:164:18:164:47 | { ... } : ValueTuple,Int32> [field Item2, field Item2] : String | Tuples.cs:164:43:164:43 | access to local variable t : ValueTuple [field Item2] : String | provenance | | +| Tuples.cs:164:23:164:24 | access to local variable a3 : String | Tuples.cs:166:18:166:19 | access to local variable a3 | provenance | | +| Tuples.cs:164:23:164:24 | access to local variable a3 : String | Tuples.cs:166:18:166:19 | access to local variable a3 | provenance | | +| Tuples.cs:164:43:164:43 | access to local variable t : ValueTuple [field Item2] : String | Tuples.cs:167:18:167:18 | access to local variable t : ValueTuple [field Item2] : String | provenance | | +| Tuples.cs:164:43:164:43 | access to local variable t : ValueTuple [field Item2] : String | Tuples.cs:167:18:167:18 | access to local variable t : ValueTuple [field Item2] : String | provenance | | | Tuples.cs:167:18:167:18 | access to local variable t : ValueTuple [field Item2] : String | Tuples.cs:167:18:167:24 | access to field Item2 | provenance | | | Tuples.cs:167:18:167:18 | access to local variable t : ValueTuple [field Item2] : String | Tuples.cs:167:18:167:24 | access to field Item2 | provenance | | nodes @@ -435,6 +459,10 @@ nodes | Tuples.cs:59:22:59:28 | (..., ...) : ValueTuple [field Item2] : String | semmle.label | (..., ...) : ValueTuple [field Item2] : String | | Tuples.cs:59:26:59:27 | access to local variable o2 : String | semmle.label | access to local variable o2 : String | | Tuples.cs:59:26:59:27 | access to local variable o2 : String | semmle.label | access to local variable o2 : String | +| Tuples.cs:62:57:62:57 | access to local variable t : ValueTuple,Int32> [field Item1] : String | semmle.label | access to local variable t : ValueTuple,Int32> [field Item1] : String | +| Tuples.cs:62:57:62:57 | access to local variable t : ValueTuple,Int32> [field Item1] : String | semmle.label | access to local variable t : ValueTuple,Int32> [field Item1] : String | +| Tuples.cs:62:57:62:57 | access to local variable t : ValueTuple,Int32> [field Item2, field Item2] : String | semmle.label | access to local variable t : ValueTuple,Int32> [field Item2, field Item2] : String | +| Tuples.cs:62:57:62:57 | access to local variable t : ValueTuple,Int32> [field Item2, field Item2] : String | semmle.label | access to local variable t : ValueTuple,Int32> [field Item2, field Item2] : String | | Tuples.cs:63:22:63:22 | access to local variable t : ValueTuple,Int32> [field Item1] : String | semmle.label | access to local variable t : ValueTuple,Int32> [field Item1] : String | | Tuples.cs:63:22:63:22 | access to local variable t : ValueTuple,Int32> [field Item1] : String | semmle.label | access to local variable t : ValueTuple,Int32> [field Item1] : String | | Tuples.cs:63:22:63:28 | access to field Item1 | semmle.label | access to field Item1 | @@ -451,6 +479,10 @@ nodes | Tuples.cs:67:18:67:35 | (..., ...) : ValueTuple,Int32> [field Item1] : String | semmle.label | (..., ...) : ValueTuple,Int32> [field Item1] : String | | Tuples.cs:67:18:67:35 | (..., ...) : ValueTuple,Int32> [field Item2, field Item2] : String | semmle.label | (..., ...) : ValueTuple,Int32> [field Item2, field Item2] : String | | Tuples.cs:67:18:67:35 | (..., ...) : ValueTuple,Int32> [field Item2, field Item2] : String | semmle.label | (..., ...) : ValueTuple,Int32> [field Item2, field Item2] : String | +| Tuples.cs:67:23:67:23 | access to local variable a : String | semmle.label | access to local variable a : String | +| Tuples.cs:67:23:67:23 | access to local variable a : String | semmle.label | access to local variable a : String | +| Tuples.cs:67:30:67:30 | access to local variable c : String | semmle.label | access to local variable c : String | +| Tuples.cs:67:30:67:30 | access to local variable c : String | semmle.label | access to local variable c : String | | Tuples.cs:68:22:68:22 | access to local variable a | semmle.label | access to local variable a | | Tuples.cs:68:22:68:22 | access to local variable a | semmle.label | access to local variable a | | Tuples.cs:69:22:69:22 | access to local variable c | semmle.label | access to local variable c | @@ -461,6 +493,10 @@ nodes | Tuples.cs:87:18:87:35 | (..., ...) : ValueTuple,Int32> [field Item1] : String | semmle.label | (..., ...) : ValueTuple,Int32> [field Item1] : String | | Tuples.cs:87:18:87:35 | (..., ...) : ValueTuple,Int32> [field Item2, field Item2] : String | semmle.label | (..., ...) : ValueTuple,Int32> [field Item2, field Item2] : String | | Tuples.cs:87:18:87:35 | (..., ...) : ValueTuple,Int32> [field Item2, field Item2] : String | semmle.label | (..., ...) : ValueTuple,Int32> [field Item2, field Item2] : String | +| Tuples.cs:87:23:87:23 | access to local variable p : String | semmle.label | access to local variable p : String | +| Tuples.cs:87:23:87:23 | access to local variable p : String | semmle.label | access to local variable p : String | +| Tuples.cs:87:30:87:30 | access to local variable r : String | semmle.label | access to local variable r : String | +| Tuples.cs:87:30:87:30 | access to local variable r : String | semmle.label | access to local variable r : String | | Tuples.cs:89:18:89:18 | access to local variable p | semmle.label | access to local variable p | | Tuples.cs:89:18:89:18 | access to local variable p | semmle.label | access to local variable p | | Tuples.cs:90:18:90:18 | access to local variable r | semmle.label | access to local variable r | @@ -549,8 +585,12 @@ nodes | Tuples.cs:144:18:144:46 | { ... } : ValueTuple,Int32> [field Item1] : String | semmle.label | { ... } : ValueTuple,Int32> [field Item1] : String | | Tuples.cs:144:18:144:46 | { ... } : ValueTuple,Int32> [field Item2, field Item2] : String | semmle.label | { ... } : ValueTuple,Int32> [field Item2, field Item2] : String | | Tuples.cs:144:18:144:46 | { ... } : ValueTuple,Int32> [field Item2, field Item2] : String | semmle.label | { ... } : ValueTuple,Int32> [field Item2, field Item2] : String | +| Tuples.cs:144:23:144:24 | access to local variable a1 : String | semmle.label | access to local variable a1 : String | +| Tuples.cs:144:23:144:24 | access to local variable a1 : String | semmle.label | access to local variable a1 : String | | Tuples.cs:144:27:144:42 | { ... } : ValueTuple [field Item2] : String | semmle.label | { ... } : ValueTuple [field Item2] : String | | Tuples.cs:144:27:144:42 | { ... } : ValueTuple [field Item2] : String | semmle.label | { ... } : ValueTuple [field Item2] : String | +| Tuples.cs:144:40:144:41 | access to local variable c1 : String | semmle.label | access to local variable c1 : String | +| Tuples.cs:144:40:144:41 | access to local variable c1 : String | semmle.label | access to local variable c1 : String | | Tuples.cs:145:22:145:23 | access to local variable a1 | semmle.label | access to local variable a1 | | Tuples.cs:145:22:145:23 | access to local variable a1 | semmle.label | access to local variable a1 | | Tuples.cs:146:22:146:23 | access to local variable c1 | semmle.label | access to local variable c1 | @@ -581,8 +621,12 @@ nodes | Tuples.cs:154:18:154:42 | { ... } : ValueTuple,Int32> [field Item1] : String | semmle.label | { ... } : ValueTuple,Int32> [field Item1] : String | | Tuples.cs:154:18:154:42 | { ... } : ValueTuple,Int32> [field Item2, field Item2] : String | semmle.label | { ... } : ValueTuple,Int32> [field Item2, field Item2] : String | | Tuples.cs:154:18:154:42 | { ... } : ValueTuple,Int32> [field Item2, field Item2] : String | semmle.label | { ... } : ValueTuple,Int32> [field Item2, field Item2] : String | +| Tuples.cs:154:23:154:24 | access to local variable a2 : String | semmle.label | access to local variable a2 : String | +| Tuples.cs:154:23:154:24 | access to local variable a2 : String | semmle.label | access to local variable a2 : String | | Tuples.cs:154:27:154:38 | (..., ...) : ValueTuple [field Item2] : String | semmle.label | (..., ...) : ValueTuple [field Item2] : String | | Tuples.cs:154:27:154:38 | (..., ...) : ValueTuple [field Item2] : String | semmle.label | (..., ...) : ValueTuple [field Item2] : String | +| Tuples.cs:154:36:154:37 | access to local variable c2 : String | semmle.label | access to local variable c2 : String | +| Tuples.cs:154:36:154:37 | access to local variable c2 : String | semmle.label | access to local variable c2 : String | | Tuples.cs:156:18:156:19 | access to local variable a2 | semmle.label | access to local variable a2 | | Tuples.cs:156:18:156:19 | access to local variable a2 | semmle.label | access to local variable a2 | | Tuples.cs:157:18:157:19 | access to local variable c2 | semmle.label | access to local variable c2 | @@ -613,6 +657,10 @@ nodes | Tuples.cs:164:18:164:47 | { ... } : ValueTuple,Int32> [field Item1] : String | semmle.label | { ... } : ValueTuple,Int32> [field Item1] : String | | Tuples.cs:164:18:164:47 | { ... } : ValueTuple,Int32> [field Item2, field Item2] : String | semmle.label | { ... } : ValueTuple,Int32> [field Item2, field Item2] : String | | Tuples.cs:164:18:164:47 | { ... } : ValueTuple,Int32> [field Item2, field Item2] : String | semmle.label | { ... } : ValueTuple,Int32> [field Item2, field Item2] : String | +| Tuples.cs:164:23:164:24 | access to local variable a3 : String | semmle.label | access to local variable a3 : String | +| Tuples.cs:164:23:164:24 | access to local variable a3 : String | semmle.label | access to local variable a3 : String | +| Tuples.cs:164:43:164:43 | access to local variable t : ValueTuple [field Item2] : String | semmle.label | access to local variable t : ValueTuple [field Item2] : String | +| Tuples.cs:164:43:164:43 | access to local variable t : ValueTuple [field Item2] : String | semmle.label | access to local variable t : ValueTuple [field Item2] : String | | Tuples.cs:166:18:166:19 | access to local variable a3 | semmle.label | access to local variable a3 | | Tuples.cs:166:18:166:19 | access to local variable a3 | semmle.label | access to local variable a3 | | Tuples.cs:167:18:167:18 | access to local variable t : ValueTuple [field Item2] : String | semmle.label | access to local variable t : ValueTuple [field Item2] : String | diff --git a/csharp/ql/test/library-tests/dataflow/types/Types.expected b/csharp/ql/test/library-tests/dataflow/types/Types.expected index ee55dc144b70..13cc8da9000b 100644 --- a/csharp/ql/test/library-tests/dataflow/types/Types.expected +++ b/csharp/ql/test/library-tests/dataflow/types/Types.expected @@ -18,8 +18,10 @@ edges | Types.cs:40:12:40:18 | object creation of type D : D | Types.cs:71:25:71:25 | x : D | provenance | | | Types.cs:43:16:43:16 | access to local variable o : null | Types.cs:44:14:44:14 | access to local variable o | provenance | | | Types.cs:43:20:43:23 | null : null | Types.cs:43:16:43:16 | access to local variable o : null | provenance | | -| Types.cs:47:22:47:22 | a : C | Types.cs:50:18:50:18 | access to local variable c | provenance | | -| Types.cs:53:22:53:22 | a : D | Types.cs:58:22:58:22 | access to local variable d | provenance | | +| Types.cs:47:22:47:22 | a : C | Types.cs:49:20:49:20 | access to local variable c : C | provenance | | +| Types.cs:49:20:49:20 | access to local variable c : C | Types.cs:50:18:50:18 | access to local variable c | provenance | | +| Types.cs:53:22:53:22 | a : D | Types.cs:57:20:57:20 | access to local variable d : D | provenance | | +| Types.cs:57:20:57:20 | access to local variable d : D | Types.cs:58:22:58:22 | access to local variable d | provenance | | | Types.cs:63:22:63:22 | a : C | Types.cs:63:33:63:36 | (...) ... | provenance | | | Types.cs:65:25:65:25 | x : C | Types.cs:65:36:65:36 | access to parameter x | provenance | | | Types.cs:65:25:65:25 | x : D | Types.cs:65:36:65:36 | access to parameter x | provenance | | @@ -31,7 +33,8 @@ edges | Types.cs:73:17:73:17 | access to local variable d : D | Types.cs:74:9:74:9 | access to local variable d : D | provenance | | | Types.cs:73:21:73:21 | (...) ... : D | Types.cs:73:17:73:17 | access to local variable d : D | provenance | | | Types.cs:74:9:74:9 | access to local variable d : D | Types.cs:16:30:16:30 | this : D | provenance | | -| Types.cs:77:22:77:22 | a : C | Types.cs:80:18:80:18 | access to local variable b | provenance | | +| Types.cs:77:22:77:22 | a : C | Types.cs:79:25:79:25 | access to local variable b : C | provenance | | +| Types.cs:79:25:79:25 | access to local variable b : C | Types.cs:80:18:80:18 | access to local variable b | provenance | | | Types.cs:90:22:90:22 | e : Types+E.E2 | Types.cs:92:26:92:26 | access to parameter e : Types+E.E2 | provenance | | | Types.cs:92:13:92:16 | [post] this access : Types+E [field Field] : Types+E.E2 | Types.cs:93:13:93:16 | this access : Types+E [field Field] : Types+E.E2 | provenance | | | Types.cs:92:26:92:26 | access to parameter e : Types+E.E2 | Types.cs:92:13:92:16 | [post] this access : Types+E [field Field] : Types+E.E2 | provenance | | @@ -81,8 +84,10 @@ nodes | Types.cs:43:20:43:23 | null : null | semmle.label | null : null | | Types.cs:44:14:44:14 | access to local variable o | semmle.label | access to local variable o | | Types.cs:47:22:47:22 | a : C | semmle.label | a : C | +| Types.cs:49:20:49:20 | access to local variable c : C | semmle.label | access to local variable c : C | | Types.cs:50:18:50:18 | access to local variable c | semmle.label | access to local variable c | | Types.cs:53:22:53:22 | a : D | semmle.label | a : D | +| Types.cs:57:20:57:20 | access to local variable d : D | semmle.label | access to local variable d : D | | Types.cs:58:22:58:22 | access to local variable d | semmle.label | access to local variable d | | Types.cs:63:22:63:22 | a : C | semmle.label | a : C | | Types.cs:63:33:63:36 | (...) ... | semmle.label | (...) ... | @@ -100,6 +105,7 @@ nodes | Types.cs:73:21:73:21 | (...) ... : D | semmle.label | (...) ... : D | | Types.cs:74:9:74:9 | access to local variable d : D | semmle.label | access to local variable d : D | | Types.cs:77:22:77:22 | a : C | semmle.label | a : C | +| Types.cs:79:25:79:25 | access to local variable b : C | semmle.label | access to local variable b : C | | Types.cs:80:18:80:18 | access to local variable b | semmle.label | access to local variable b | | Types.cs:90:22:90:22 | e : Types+E.E2 | semmle.label | e : Types+E.E2 | | Types.cs:92:13:92:16 | [post] this access : Types+E [field Field] : Types+E.E2 | semmle.label | [post] this access : Types+E [field Field] : Types+E.E2 | diff --git a/csharp/ql/test/library-tests/definitions/PrintAst.expected b/csharp/ql/test/library-tests/definitions/PrintAst.expected index fd9adbb2bff0..cd5f8064a9a2 100644 --- a/csharp/ql/test/library-tests/definitions/PrintAst.expected +++ b/csharp/ql/test/library-tests/definitions/PrintAst.expected @@ -503,7 +503,8 @@ definitions.cs: # 211| 0: [IsExpr] ... is ... # 211| 0: [LocalVariableAccess] access to local variable c8a # 211| 1: [VariablePatternExpr] C8 c8b -# 211| 0: [TypeMention] C8 +# 211| -1: [TypeMention] C8 +# 211| 0: [LocalVariableAccess] access to local variable c8b # 212| 1: [ExprStmt] ...; # 212| 0: [AssignExpr] ... = ... # 212| 0: [LocalVariableAccess] access to local variable c8a @@ -512,7 +513,8 @@ definitions.cs: # 213| 0: [LocalVariableAccess] access to local variable c8a # 215| 0: [CaseStmt] case ...: # 215| 0: [VariablePatternExpr] C8 c8c -# 215| 0: [TypeMention] C8 +# 215| -1: [TypeMention] C8 +# 215| 0: [LocalVariableAccess] access to local variable c8c # 215| 1: [NEExpr] ... != ... # 215| 0: [LocalVariableAccess] access to local variable c8c # 215| 1: [NullLiteral] null From bd0ebb6703869c6b0ec7ea2e57483a6f76ffb478 Mon Sep 17 00:00:00 2001 From: Tom Hvitved Date: Fri, 20 Nov 2026 16:55:06 +0100 Subject: [PATCH 3/3] C#: Update pattern-variable access expectations Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- .../controlflow/guards/BooleanGuardedExpr.expected | 3 +++ .../controlflow/guards/GuardedControlFlowNode.expected | 3 +++ .../library-tests/controlflow/guards/GuardedExpr.expected | 3 +++ csharp/ql/test/library-tests/frameworks/OData/OData.expected | 4 +++- csharp/ql/test/library-tests/regressions/WhileIs.expected | 1 + .../standalone/regressions/QualifierAccess.expected | 1 + 6 files changed, 14 insertions(+), 1 deletion(-) diff --git a/csharp/ql/test/library-tests/controlflow/guards/BooleanGuardedExpr.expected b/csharp/ql/test/library-tests/controlflow/guards/BooleanGuardedExpr.expected index 374550924481..e6a15ced8697 100644 --- a/csharp/ql/test/library-tests/controlflow/guards/BooleanGuardedExpr.expected +++ b/csharp/ql/test/library-tests/controlflow/guards/BooleanGuardedExpr.expected @@ -58,6 +58,8 @@ | Guards.cs:132:16:132:16 | access to parameter s | Guards.cs:130:13:130:21 | ... is ... | Guards.cs:130:13:130:13 | access to parameter s | false | | Guards.cs:138:20:138:20 | access to parameter s | Guards.cs:137:13:137:25 | ... is ... | Guards.cs:137:13:137:13 | access to parameter s | true | | Guards.cs:139:16:139:16 | access to parameter s | Guards.cs:137:13:137:25 | ... is ... | Guards.cs:137:13:137:13 | access to parameter s | false | +| Guards.cs:144:25:144:25 | access to local variable s | Guards.cs:144:13:144:25 | ... is ... | Guards.cs:144:25:144:25 | access to local variable s | true | +| Guards.cs:145:20:145:20 | access to local variable s | Guards.cs:144:13:144:25 | ... is ... | Guards.cs:144:25:144:25 | access to local variable s | true | | Guards.cs:146:16:146:16 | access to parameter o | Guards.cs:144:13:144:25 | ... is ... | Guards.cs:144:13:144:13 | access to parameter o | false | | Guards.cs:169:31:169:31 | access to parameter x | Guards.cs:168:14:168:41 | call to method IsNullOrWhiteSpace | Guards.cs:168:40:168:40 | access to parameter x | false | | Guards.cs:190:31:190:31 | access to parameter s | Guards.cs:189:14:189:25 | call to method NullTest1 | Guards.cs:189:24:189:24 | access to parameter s | false | @@ -70,6 +72,7 @@ | Guards.cs:269:13:269:14 | access to parameter o1 | Guards.cs:268:13:268:41 | call to operator == | Guards.cs:268:13:268:14 | access to parameter o1 | true | | Guards.cs:271:13:271:14 | access to parameter o1 | Guards.cs:270:13:270:42 | call to operator == | Guards.cs:270:13:270:14 | access to parameter o1 | true | | Guards.cs:279:17:279:17 | access to parameter o | Guards.cs:278:13:279:28 | ... => ... | Guards.cs:279:17:279:17 | access to parameter o | true | +| Guards.cs:281:17:281:17 | access to local variable a | Guards.cs:280:13:281:28 | ... => ... | Guards.cs:280:28:280:28 | access to local variable a | true | | Guards.cs:281:17:281:17 | access to local variable a | Guards.cs:280:13:281:28 | ... => ... | Guards.cs:281:17:281:17 | access to local variable a | true | | Guards.cs:283:17:283:17 | access to parameter o | Guards.cs:278:13:279:28 | ... => ... | Guards.cs:279:17:279:17 | access to parameter o | false | | Guards.cs:283:17:283:17 | access to parameter o | Guards.cs:282:13:283:28 | ... => ... | Guards.cs:283:17:283:17 | access to parameter o | true | diff --git a/csharp/ql/test/library-tests/controlflow/guards/GuardedControlFlowNode.expected b/csharp/ql/test/library-tests/controlflow/guards/GuardedControlFlowNode.expected index 765b8670a18e..577a21887181 100644 --- a/csharp/ql/test/library-tests/controlflow/guards/GuardedControlFlowNode.expected +++ b/csharp/ql/test/library-tests/controlflow/guards/GuardedControlFlowNode.expected @@ -148,6 +148,8 @@ | Guards.cs:138:20:138:20 | access to parameter s | Guards.cs:137:13:137:25 | ... is ... | Guards.cs:137:13:137:13 | access to parameter s | true | | Guards.cs:139:16:139:16 | access to parameter s | Guards.cs:137:13:137:13 | access to parameter s | Guards.cs:137:13:137:13 | access to parameter s | null | | Guards.cs:139:16:139:16 | access to parameter s | Guards.cs:137:13:137:25 | ... is ... | Guards.cs:137:13:137:13 | access to parameter s | false | +| Guards.cs:144:25:144:25 | access to local variable s | Guards.cs:144:13:144:25 | ... is ... | Guards.cs:144:25:144:25 | access to local variable s | true | +| Guards.cs:145:20:145:20 | access to local variable s | Guards.cs:144:13:144:25 | ... is ... | Guards.cs:144:25:144:25 | access to local variable s | true | | Guards.cs:146:16:146:16 | access to parameter o | Guards.cs:144:13:144:25 | ... is ... | Guards.cs:144:13:144:13 | access to parameter o | false | | Guards.cs:154:24:154:24 | access to parameter o | Guards.cs:151:17:151:17 | access to parameter o | Guards.cs:151:17:151:17 | access to parameter o | not null | | Guards.cs:158:24:158:24 | access to parameter o | Guards.cs:151:17:151:17 | access to parameter o | Guards.cs:151:17:151:17 | access to parameter o | | @@ -178,6 +180,7 @@ | Guards.cs:279:17:279:17 | access to parameter o | Guards.cs:276:16:276:16 | access to parameter o | Guards.cs:276:16:276:16 | access to parameter o | not null | | Guards.cs:279:17:279:17 | access to parameter o | Guards.cs:278:13:279:28 | ... => ... | Guards.cs:279:17:279:17 | access to parameter o | true | | Guards.cs:279:17:279:28 | call to method ToString | Guards.cs:278:13:279:28 | ... => ... | Guards.cs:279:17:279:28 | call to method ToString | true | +| Guards.cs:281:17:281:17 | access to local variable a | Guards.cs:280:13:281:28 | ... => ... | Guards.cs:280:28:280:28 | access to local variable a | true | | Guards.cs:281:17:281:17 | access to local variable a | Guards.cs:280:13:281:28 | ... => ... | Guards.cs:281:17:281:17 | access to local variable a | true | | Guards.cs:281:17:281:28 | call to method ToString | Guards.cs:280:13:281:28 | ... => ... | Guards.cs:281:17:281:28 | call to method ToString | true | | Guards.cs:283:17:283:17 | access to parameter o | Guards.cs:276:16:276:16 | access to parameter o | Guards.cs:276:16:276:16 | access to parameter o | | diff --git a/csharp/ql/test/library-tests/controlflow/guards/GuardedExpr.expected b/csharp/ql/test/library-tests/controlflow/guards/GuardedExpr.expected index 765b8670a18e..577a21887181 100644 --- a/csharp/ql/test/library-tests/controlflow/guards/GuardedExpr.expected +++ b/csharp/ql/test/library-tests/controlflow/guards/GuardedExpr.expected @@ -148,6 +148,8 @@ | Guards.cs:138:20:138:20 | access to parameter s | Guards.cs:137:13:137:25 | ... is ... | Guards.cs:137:13:137:13 | access to parameter s | true | | Guards.cs:139:16:139:16 | access to parameter s | Guards.cs:137:13:137:13 | access to parameter s | Guards.cs:137:13:137:13 | access to parameter s | null | | Guards.cs:139:16:139:16 | access to parameter s | Guards.cs:137:13:137:25 | ... is ... | Guards.cs:137:13:137:13 | access to parameter s | false | +| Guards.cs:144:25:144:25 | access to local variable s | Guards.cs:144:13:144:25 | ... is ... | Guards.cs:144:25:144:25 | access to local variable s | true | +| Guards.cs:145:20:145:20 | access to local variable s | Guards.cs:144:13:144:25 | ... is ... | Guards.cs:144:25:144:25 | access to local variable s | true | | Guards.cs:146:16:146:16 | access to parameter o | Guards.cs:144:13:144:25 | ... is ... | Guards.cs:144:13:144:13 | access to parameter o | false | | Guards.cs:154:24:154:24 | access to parameter o | Guards.cs:151:17:151:17 | access to parameter o | Guards.cs:151:17:151:17 | access to parameter o | not null | | Guards.cs:158:24:158:24 | access to parameter o | Guards.cs:151:17:151:17 | access to parameter o | Guards.cs:151:17:151:17 | access to parameter o | | @@ -178,6 +180,7 @@ | Guards.cs:279:17:279:17 | access to parameter o | Guards.cs:276:16:276:16 | access to parameter o | Guards.cs:276:16:276:16 | access to parameter o | not null | | Guards.cs:279:17:279:17 | access to parameter o | Guards.cs:278:13:279:28 | ... => ... | Guards.cs:279:17:279:17 | access to parameter o | true | | Guards.cs:279:17:279:28 | call to method ToString | Guards.cs:278:13:279:28 | ... => ... | Guards.cs:279:17:279:28 | call to method ToString | true | +| Guards.cs:281:17:281:17 | access to local variable a | Guards.cs:280:13:281:28 | ... => ... | Guards.cs:280:28:280:28 | access to local variable a | true | | Guards.cs:281:17:281:17 | access to local variable a | Guards.cs:280:13:281:28 | ... => ... | Guards.cs:281:17:281:17 | access to local variable a | true | | Guards.cs:281:17:281:28 | call to method ToString | Guards.cs:280:13:281:28 | ... => ... | Guards.cs:281:17:281:28 | call to method ToString | true | | Guards.cs:283:17:283:17 | access to parameter o | Guards.cs:276:16:276:16 | access to parameter o | Guards.cs:276:16:276:16 | access to parameter o | | diff --git a/csharp/ql/test/library-tests/frameworks/OData/OData.expected b/csharp/ql/test/library-tests/frameworks/OData/OData.expected index 1c69969e8756..3f9bdb49ac36 100644 --- a/csharp/ql/test/library-tests/frameworks/OData/OData.expected +++ b/csharp/ql/test/library-tests/frameworks/OData/OData.expected @@ -11,8 +11,9 @@ edges | OData.cs:53:17:53:22 | access to local variable entity : BoundEntity1 | OData.cs:57:18:57:38 | access to property Owner | provenance | | | OData.cs:53:17:53:22 | access to local variable entity : BoundEntity1 | OData.cs:60:22:60:28 | access to property Owner | provenance | | | OData.cs:53:26:53:59 | (...) ... : BoundEntity1 | OData.cs:53:17:53:22 | access to local variable entity : BoundEntity1 | provenance | | -| OData.cs:64:55:64:64 | parameters : ODataActionParameters | OData.cs:70:26:70:35 | access to property Label | provenance | | +| OData.cs:64:55:64:64 | parameters : ODataActionParameters | OData.cs:66:65:66:70 | access to local variable items1 : IEnumerable | provenance | | | OData.cs:64:55:64:64 | parameters : ODataActionParameters | OData.cs:74:26:74:72 | ... as ... : IEnumerable | provenance | | +| OData.cs:66:65:66:70 | access to local variable items1 : IEnumerable | OData.cs:70:26:70:35 | access to property Label | provenance | | | OData.cs:74:17:74:22 | access to local variable items2 : IEnumerable | OData.cs:77:22:77:34 | access to property Category | provenance | | | OData.cs:74:26:74:72 | ... as ... : IEnumerable | OData.cs:74:17:74:22 | access to local variable items2 : IEnumerable | provenance | | | OData.cs:81:52:81:61 | parameters : ODataActionParameters | OData.cs:83:24:83:62 | (...) ... : ODataActionParameters | provenance | | @@ -44,6 +45,7 @@ nodes | OData.cs:57:18:57:38 | access to property Owner | semmle.label | access to property Owner | | OData.cs:60:22:60:28 | access to property Owner | semmle.label | access to property Owner | | OData.cs:64:55:64:64 | parameters : ODataActionParameters | semmle.label | parameters : ODataActionParameters | +| OData.cs:66:65:66:70 | access to local variable items1 : IEnumerable | semmle.label | access to local variable items1 : IEnumerable | | OData.cs:70:26:70:35 | access to property Label | semmle.label | access to property Label | | OData.cs:74:17:74:22 | access to local variable items2 : IEnumerable | semmle.label | access to local variable items2 : IEnumerable | | OData.cs:74:26:74:72 | ... as ... : IEnumerable | semmle.label | ... as ... : IEnumerable | diff --git a/csharp/ql/test/library-tests/regressions/WhileIs.expected b/csharp/ql/test/library-tests/regressions/WhileIs.expected index ba7028a856ff..78982ac15349 100644 --- a/csharp/ql/test/library-tests/regressions/WhileIs.expected +++ b/csharp/ql/test/library-tests/regressions/WhileIs.expected @@ -1 +1,2 @@ +| Program.cs:88:28:88:28 | access to local variable s | | Program.cs:90:21:90:21 | access to local variable s | diff --git a/csharp/ql/test/library-tests/standalone/regressions/QualifierAccess.expected b/csharp/ql/test/library-tests/standalone/regressions/QualifierAccess.expected index bf63ae3639b8..09b238760932 100644 --- a/csharp/ql/test/library-tests/standalone/regressions/QualifierAccess.expected +++ b/csharp/ql/test/library-tests/standalone/regressions/QualifierAccess.expected @@ -1,3 +1,4 @@ | regressions.cs:5:13:5:13 | access to local variable x | write | | regressions.cs:6:9:6:9 | access to local variable x | read | | regressions.cs:7:17:7:17 | access to local variable x | read | +| regressions.cs:18:22:18:22 | access to local variable x | write |