Commit Graph

38 Commits

Author SHA1 Message Date
Anders Schack-Mulligen
e4ee7c95c5 C#: Address review comments. 2025-12-04 15:06:20 +01:00
Anders Schack-Mulligen
67a2bced0d C#: Accept CFG dead ends for compilation errors. 2025-12-02 13:49:18 +01:00
Anders Schack-Mulligen
7e4e872430 C#: Accept expected changes. 2025-12-02 13:49:16 +01:00
Michael Nebel
5c931fa897 C#: Improve comments. 2025-03-05 09:50:52 +01:00
Michael Nebel
3b764b0640 C#: Update test expected output. 2025-03-05 09:04:56 +01:00
Michael Nebel
9af170f60e C#: Add BMN test using broken types. 2025-03-05 09:04:50 +01:00
Tom Hvitved
8ec4f0b5bd C#: Update expected test output 2024-05-02 14:53:02 +02:00
Michael Nebel
a24a57c586 C#: Update most other test cases to reflect the synthesized constructor calls and bodies. 2024-02-22 13:33:30 +01:00
Michael Nebel
fd12c3a3ba C#: Update expected test output. 2023-12-08 16:10:38 +01:00
Tamas Vajk
253c658ad2 C#: Tolerate missing call targets in LogMessageSink 2023-11-21 10:13:18 +01:00
Tamas Vajk
f0e20fa69e C#: Add test case for missing log message sinks with ambiguous types 2023-11-21 10:09:05 +01:00
Tamas Vajk
7a001f4905 C#: Fix assembly attribute extraction in standalone mode 2023-11-15 12:21:03 +01:00
Tamas Vajk
b2514b3c69 Adjust expected test output 2023-10-02 13:35:16 +02:00
Tom Hvitved
b69188fee9 C#: Adopt shared CFG construction library from shared controlflow pack 2023-08-03 14:12:24 +02:00
Tom Hvitved
99b9d4513b C#: Update expected test output after passing in --qltest in codeql test run 2022-01-26 10:33:00 +01:00
Tom Hvitved
c39fe59a04 C#: Populate UnknownType 2021-12-06 14:09:17 +01:00
Tamas Vajk
5e2770339f Add adjusted expected files 2021-07-01 16:09:11 +02:00
Tamas Vajk
03d1a3e0ad Trim test files + remove duplicate newlines 2021-07-01 16:09:11 +02:00
Tamas Vajk
c29d11087b C#: Start using 'options' files in tests 2021-07-01 16:08:47 +02:00
Tamas Vajk
b05e211e21 Fix failing test 2021-04-22 09:21:45 +02:00
Tamas Vajk
a0f5e45ae9 C#: Fix special case of default argument value extraction 2021-04-21 16:34:29 +02:00
Tamas Vajk
c069c3384e Fix tests 2021-04-08 12:07:36 +02:00
Tom Hvitved
6723e5b31c C#: Restrict post-dominance to normal execution 2020-10-30 09:14:12 +01:00
Calum Grant
da6c37d7dc C#: Update test output. 2020-05-15 15:40:49 +01:00
Calum Grant
b94b4b7c91 C#: Fix tests 2020-03-26 20:40:40 +00:00
Tom Hvitved
f1193d084b C#: Add missing toString() relations 2019-12-16 19:38:46 +01:00
Tom Hvitved
e70f17f260 C#: Remove uses of deprecated ControlFlowGraph module 2019-06-17 10:23:23 +02:00
Tom Hvitved
a1e58cedac C#: Refactor recursive patterns implementation
- Extract names of properties in a propery match, using the `exprorstmt_name` relation.
- Simplify extraction of properties by not distinguishing between top-level patterns
  and nested patterns.
- Introduce `PatternExpr` to capture patterns in `is` expressions, `case` statements,
  and `switch` expression arms.
- Generalize `IsTypeExpr`, `IsPatternExpr`, `IsRecursivePatternExpr`, and `IsConstantExpr`
  to just `IsExpr` with a member predicate `PatternExpr getPattern()`.
- Generalize `TypeCase`, `RecursivePatternCase`, and `ConstCase` to just `CaseStmt` with
  a member predicate `PatternExpr getPattern()`.
- Introduce classes `Switch` and `Case` as base classes of switch statements/expressions
  and case statements/switch expression arms, respectively.
- Simplify CFG logic using the generalized classes.
- Generalize guards library to cover `switch` expressions tests.
- Generalize data flow library to cover `switch` expression assignments.
2019-05-24 13:49:05 +01:00
calum
343cddcbb7 C#: Refactor extractor errors and log extractor errors to the database. 2019-05-13 09:18:52 +01:00
Tom Hvitved
e01246acc8 C#: Autoformat 2019-03-26 13:38:47 +01:00
Tom Hvitved
5ce9b25ec9 C#: Improve CFG for assignments
Write accesses in assignments, such as the access to `x` in `x = 0` are not
evaluated, so they should not have entries in the control flow graph. However,
qualifiers (and indexer arguments) should still be evaluated, for example in

```
x.Foo.Bar = 0;
```

the CFG should be `x --> x.Foo --> 0 --> x.Foo.Bar = 0` (as opposed to
`x --> x.Foo --> x.Foo.Bar --> 0 --> x.Foo.Bar = 0`, prior to this change).

A special case is assignments via acessors (properties, indexers, and event
adders), where we do want to include the access in the control flow graph,
as it represents the accessor call:

```
x.Prop = 0;
```

But instead of `x --> x.set_Prop --> 0 --> x.Prop = 0` the CFG should be
`x --> 0 --> x.set_Prop --> x.Prop = 0`, as the setter is called *after* the
assigned value has been evaluated.

An even more special case is tuple assignments via accessors:

```
(x.Prop1, y.Prop2) = (0, 1);
```

Here the CFG should be
`x --> y --> 0 --> 1 --> x.set_Prop1 --> y.set_Prop2 --> (x.Prop1, y.Prop2) = (0, 1)`.
2019-02-16 19:19:24 +01:00
calumgrant
1b11abfec7 Merge pull request #709 from hvitved/csharp/autoformat/tests
C#: Autoformat QL tests
2018-12-21 11:12:31 +00:00
Tom Hvitved
231465143d C#: Autoformat QL tests 2018-12-20 10:19:59 +01:00
calum
6a54a6d3e5 C#: Fix changed unit tests. 2018-12-19 11:03:05 +00:00
Tom Hvitved
05e00ab05b C#: Fix whitespaces 2018-09-28 14:59:39 +02:00
calum
ecb3efba34 C#: Fix merge conflicts. 2018-09-07 18:12:28 +01:00
calum
9ec2172dca C#: Fix CFG for unknown expressions, and add a test that also covers object initializer lists fixed by the extractor. 2018-09-07 17:56:44 +01:00
Pavel Avgustinov
b55526aa58 QL code and tests for C#/C++/JavaScript. 2018-08-02 17:53:23 +01:00