Commit Graph

35 Commits

Author SHA1 Message Date
Anders Schack-Mulligen
b392767252 C#: Accept qltest changes. 2025-10-03 15:29:35 +02:00
Tom Hvitved
35bf990f23 C#: Add data flow test for multi-body dispatch 2024-07-11 16:52:18 +02:00
Tom Hvitved
357638baa8 C#: Update variable capture test 2024-03-04 14:39:48 +01:00
Tom Hvitved
acd52192d1 C#: Adopt shared variable capture library 2024-02-26 09:53:30 +01:00
Tom Hvitved
7197c64e2d C#: Add more variable capture tests 2024-02-26 09:53:29 +01:00
Tamas Vajk
9f24b026fb C#: Move StringBuilder dataflow tests to separate file 2023-12-07 10:31:50 +01:00
Michael Nebel
95488bf133 C#: Update expected test output. 2022-09-29 11:35:35 +02:00
Michael Nebel
131a6ac492 C#: Update expected test output. 2022-09-29 11:35:35 +02:00
Michael Nebel
e1ea1a464d C#: Update expected test output. 2022-09-29 11:35:35 +02:00
Michael Nebel
940e925c31 C#: Update expected test output. 2022-09-29 11:35:35 +02:00
Michael Nebel
65b32b665d C#: Update test expected output. 2022-09-29 11:35:35 +02:00
Michael Nebel
2e5fc19e38 C#: Update expected test output. 2022-09-29 11:35:35 +02:00
Michael Nebel
e8fd2bfc78 C#: Update expected test output. 2022-09-28 14:35:09 +02:00
Tamas Vajk
b7f13a7e1f C#: Change generic method names to include <> and type args/params 2021-09-06 11:48:22 +02:00
Tamas Vajk
a90a86bcbf Fix flow from Element of Argument[0] for Int32.TryParse(ReadOnlySpan<Char>,... 2021-06-28 11:20:32 +02:00
Tom Hvitved
e1e4016a5c C#: Fix missing delegate flow 2021-03-16 13:16:23 +01:00
Tom Hvitved
94deed39a2 C#: Represent all expressions in post-order in the CFG 2020-11-12 20:04:48 +01:00
Tom Hvitved
03a36760b8 C#: Add data-flow test for ConfigureAwait() 2020-10-27 10:23:39 +01:00
Tom Hvitved
f2dc2d912a C#: Add inter-procedural data-flow test for StringBuilder 2020-10-14 14:15:34 +02:00
Tom Hvitved
31816af11e C#: Add missing data-flow for switch expressions 2020-10-07 17:10:29 +02:00
Tom Hvitved
9c503c1591 C#: Add more data/control-flow tests 2020-10-07 17:10:01 +02:00
Tom Hvitved
26544f322a C#: Update data-flow tests for System.Threading.Tasks 2020-10-03 11:13:45 +02:00
Tom Hvitved
795c5784b0 C#: Precise data flow for collections 2020-06-26 13:40:05 +02:00
Tom Hvitved
b8ae4b7f64 C#: Move async data-flow tests from local to global 2020-06-25 10:04:18 +02:00
Tom Hvitved
a9b88b6eaa C#: Update data flow tests 2020-04-14 09:31:10 +02:00
Luke Cartey
407f6349a3 C#: Fix potential bug in CaptureOutNode.
In theory this bug could associated CaptureOutNodes with the wrong transitively called
callable. However, in practice I could not create a test case that revealed incorrect
behaviour. I've included one such test case in the commit.

I believe that the cause of this is that OutNode::getACall() is not actually used in the
data flow libraries. Instead, DataFlowDispatch::Cached::getAnOutNode is the predicate
which is used to associated OutNode's with DataFlowCall's in practice, and that is always
used in a context that correctly binds the runtime target of the call.
2019-09-18 11:48:29 +01:00
Luke Cartey
4ecfe97e7b C#: Adjust line numbers in test case. 2019-09-18 10:55:59 +01:00
Luke Cartey
3c07caefe4 C#: Add test for transitive capture calls. 2019-09-17 15:21:30 +01:00
Luke Cartey
70c2cc595b C#: Add capture test for nested lambdas, commented out
Add a commented out version of the test, and modify the expected files
to contain the same results at new offsets.
2019-09-17 15:13:10 +01:00
Tom Hvitved
4d58154ff5 C#: Fix data flow for out/ref parameters 2019-08-02 14:25:38 -07:00
Tom Hvitved
04db1bf3f4 C#: Add data flow test for methods with multiple out/ref parameters 2019-08-02 13:46:18 -07:00
Tom Hvitved
dfdfae8dd6 C#: Add more data flow tests 2019-05-03 09:41:39 +02:00
Tom Hvitved
b2f99dbbc7 C#: Teach data flow library about CFG splitting
Data flow nodes for expressions do not take CFG splitting into account. Example:

```
if (b)
    x = tainted;
x = x.ToLower();
if (!b)
    Use(x);
```

Flow is incorrectly reported from `tainted` to `x` in `Use(x)`, because the step
from `tainted` to `x.ToLower()` throws away the information that `b = true`.

The solution is to remember the splitting in data flow expression nodes, that is,
to represent the exact control flow node instead of just the expression. With that
we get flow from `tainted` to `[b = true] x.ToLower()`, but not from `tainted` to
`[b = false] x.ToLower()`.

The data flow API remains unchanged, but in order for analyses to fully benefit from
CFG splitting, sanitizers in particular should be CFG-based instead of expression-based:

```
if (b)
   x = tainted;
   if (IsInvalid(x))
       return;
Use(x);
```

If the call to `IsInvalid()` is a sanitizer, then defining an expression node to be
a sanitizer using `GuardedExpr` will be too conservative (`x` in `Use(x)` is in fact
not guarded). However, `[b = true] x` in `[b = true] Use(x)` is guarded, and to help
defining guard-based sanitizers, the class `GuardedDataFlowNode` has been introduced.
2019-01-16 10:39:27 +01:00
Tom Hvitved
f768abb0e6 C#: Add data flow test with CFG splitting 2019-01-16 10:29:26 +01:00
Pavel Avgustinov
b55526aa58 QL code and tests for C#/C++/JavaScript. 2018-08-02 17:53:23 +01:00