Commit Graph

16 Commits

Author SHA1 Message Date
Michael Nebel
b3e56e6023 C#: Add dispatch examples for partial properties and indexers. 2025-01-27 10:06:56 +01:00
Michael Nebel
bc11c23f08 C#: Add dispatch tests for overload resolution and update line numbers for existing test cases. 2025-01-23 13:33:53 +01:00
Michael Nebel
ff32a382b0 C#: Update test expected output. 2025-01-03 16:27:02 +01:00
Michael Nebel
ef5ae3f1ae C#: Add some unification and viable callable test cases. 2025-01-03 15:36:07 +01:00
Michael Nebel
c8e72c08fb C#: Update tests expected output. 2025-01-02 11:13:12 +01:00
Michael Nebel
89c16abf59 C#: Add more tests for params and update expected output. 2025-01-02 11:13:09 +01:00
Michael Nebel
41b2273dee C#: Update expected test output. 2023-03-13 15:15:03 +01:00
Michael Nebel
8398ee43b3 C#: Update test comment and expected test output. 2023-03-13 10:09:03 +01:00
Michael Nebel
cfe2a76431 C#: Add viable callable test cases for statics in interfaces. 2023-03-13 10:09:03 +01:00
Michael Nebel
b7123aaa89 C#: Add viable callable testcases for regular and checked operators. 2023-02-14 12:57:59 +01:00
Tamas Vajk
9ab6c29cd3 Extend runtime callables to cover interface members with default implementation 2021-09-08 15:07:49 +02:00
Tamas Vajk
03d1a3e0ad Trim test files + remove duplicate newlines 2021-07-01 16:09:11 +02:00
Tom Hvitved
9e7ca25732 C#: Add call-sensitivity to data-flow call resolution 2020-06-03 20:43:49 +02:00
Tom Hvitved
f4b92137d9 C#: Add more virtual dispatch tests 2019-11-08 12:06:05 +01: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
Pavel Avgustinov
b55526aa58 QL code and tests for C#/C++/JavaScript. 2018-08-02 17:53:23 +01:00