Commit Graph

41 Commits

Author SHA1 Message Date
Michael Nebel
fc03c367e9 C#: Update expected test output. 2025-01-27 10:13:19 +01:00
Michael Nebel
e53c750876 C#: Update expected output for dispatch tests. 2025-01-27 10:09:28 +01:00
Michael Nebel
b3e56e6023 C#: Add dispatch examples for partial properties and indexers. 2025-01-27 10:06:56 +01:00
Michael Nebel
d924b1a536 C#: Update test expected output. 2025-01-23 13:36:09 +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
33939a8041 C#: Update test expected output. 2025-01-03 15:36:08 +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
b677e89f35 C#: Deprecate getFullyQualifiedNameWithTypes. 2024-04-08 13:46:45 +02:00
Tom Hvitved
57ec0948cf C#: Update expected test output 2023-11-10 08:46:15 +01:00
Tom Hvitved
b72f34591d C#: Use {get,has}FullyQualifiedName throughout 2023-11-10 08:46:15 +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
278f90e5fa C#: Update 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
Michael Nebel
89de6cb8a0 C#: Update library tests. 2023-01-31 13:20:59 +01:00
Michael Nebel
b8ec2254e8 C#: Update unit tests (looks like new NFloat operator has been introduced). 2022-05-03 16:36:32 +02:00
Tom Hvitved
c4ad237a5c C#: Update expected test output 2022-02-02 19:25:30 +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
b7f13a7e1f C#: Change generic method names to include <> and type args/params 2021-09-06 11:48:22 +02: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
Tom Hvitved
eca11f1b40 C#: Adjust getQualifiedName for type parameters 2021-06-17 14:47:19 +02:00
Tom Hvitved
0af44a7f94 C#: Changes to Type::{getQualifier,hasQualifiedName} 2021-06-16 19:36:05 +02:00
Tom Hvitved
cd77f14a75 C#: Rename getSourceDeclaration() to getUnboundDeclaration() 2020-11-23 16:09:33 +01:00
Tom Hvitved
9e7ca25732 C#: Add call-sensitivity to data-flow call resolution 2020-06-03 20:43:49 +02:00
Calum Grant
6e24a92179 Merge remote-tracking branch 'upstream/master' into cs/nullability-refactor 2019-11-13 14:58:58 +00:00
Calum Grant
fe83bac0fb C#: Fix up test output
C#: Fix a qltest whereby a tuple type having multiple underlying types was causing an issue with the IR sanity checks.
C#: Revert more changes.
C#: Fix tests and remove dead code.
2019-11-12 13:40:58 +00:00
Tom Hvitved
af5c60c341 C#: Use type unification library in virtual dispatch library 2019-11-08 12:06:05 +01:00
Tom Hvitved
f4b92137d9 C#: Add more virtual dispatch tests 2019-11-08 12:06:05 +01:00
Tom Hvitved
495e5bc628 C#: Extract assignments for field/property initializers 2019-08-15 16:18:23 +02:00
Tom Hvitved
b4b6fdd12b C#: Revert recent change to AccessorCall
The recent change to `AccessorCall` on dd99525566 resulted
in some bad join-orders, so I have (partly) reverted them. This means that the issues
orignally addressed by that change are now reintroduced, and I plan to instead apply a
fix to the CFG, which--unlike the original fix--should be able to handle multi-property-tuple
assignments.
2019-02-04 15:14:18 +01:00
Calum Grant
eef1abfa69 Merge pull request #743 from hvitved/csharp/dataflow-splitting
C#: Teach data flow library about CFG splitting
2019-01-28 16:31:24 +00:00
Tom Hvitved
dd99525566 C#: Redefine AccessorCall
The syntactic node assiociated with accessor calls was previously always the
underlying member access. For example, in

```
x.Prop = y.Prop;
```

the implicit call to `x.set_Prop()` was at the syntactic node `x.Prop`, while the
implicit call to `y.get_Prop()` was at the syntactic node `y.Prop`.

However, this breaks the invariant that arguments to calls dominate the call itself,
as the argument `y.Prop` for the implicit `value` parameter in `x.set_Prop()` will
be evaluated after the call (the left-hand side in an assignment is evaluated before
the right-hand side).

The solution is to redefine the access call to `x.set_Prop()` to point to the whole
assignment `x.Prop = y.Prop`, instead of the access `x.Prop`. For reads, we still want
to associate the accessor call with the member access.

A corner case arises when multiple setters are called in a tuple assignment:

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

In this case, we cannot associate the assignment with both `x.set_Prop1()` and
`x.set_Prop2()`, so we instead revert to using the underlying member accesses as
before.
2019-01-18 13:56:23 +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
Tom Hvitved
231465143d C#: Autoformat QL tests 2018-12-20 10:19:59 +01:00
Pavel Avgustinov
b55526aa58 QL code and tests for C#/C++/JavaScript. 2018-08-02 17:53:23 +01:00