Tom Hvitved
243b92b28c
C#: Avoid CIL instructions with multiple types
2021-12-06 14:42:41 +01:00
Tom Hvitved
60c0bcf8f7
C#: Include dup instructions in CIL ExprMissingType consistency test
2021-12-06 14:37:07 +01:00
Erik Krogh Kristensen
a358a192c4
add explicit this to all calls to class predicates
2021-10-14 10:11:55 +02:00
Tom Hvitved
bef05f885c
C#: Update CIL data flow tests
2021-09-07 13:02:20 +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
Tamas Vajk
7ae640ce16
Fix OS specific tests
2021-03-02 09:21:24 +01:00
Tamas Vajk
f2e667173c
C#: Add calli IL opcode extraction
2021-03-02 09:21:24 +01:00
Tamas Vajk
6205ec233c
Fix more failing tests
2021-03-02 09:21:24 +01:00
Tamás Vajk
e4ed050c87
Merge pull request #4970 from tamasvajk/feature/extraction-errors
...
C#: Fix extraction errors
2021-01-26 11:28:39 +01:00
Tamas Vajk
ab8dc27b26
Add missing 'bindingset'
2021-01-20 15:44:05 +01:00
Tamas Vajk
727412b26b
Store by-ref type annotation in trap and add tests
2021-01-20 15:44:05 +01:00
Tamas Vajk
2804f5cba9
Add by-ref, and fix pinned CIL extraction
2021-01-20 15:44:05 +01:00
Tamas Vajk
f986c15200
Add QL classes for CIL function pointers, and add test
2021-01-20 15:44:05 +01:00
Tamas Vajk
0c213d0926
C#: Extract function pointer types from CIL
2021-01-20 15:44:05 +01:00
Tamas Vajk
1b285ee792
C#: Hardcode well-known underlying enum types
2021-01-18 16:14:37 +01:00
Tamas Vajk
12c28547fc
Fix code review findings
2021-01-05 15:15:13 +01:00
Tamas Vajk
f3a0d1d138
Add test to list all custom modifiers extracted from IL
2020-12-17 15:43:41 +01:00
Tamas Vajk
7662b55ecc
C#: Extract init only accessors and custom modifiers
2020-12-17 15:43:41 +01:00
Tamas Vajk
57c163f314
C#: Add test for CIL setter extraction
2020-12-17 15:23:33 +01:00
Tamas Vajk
a7451a12fc
Fix attribute test after rebase
2020-12-09 21:24:21 +01:00
Tamas Vajk
214cc90af5
Fix failing test
2020-12-08 16:40:29 +01:00
Tamas Vajk
44dfafc52c
C#: remove 'System.Enum' from enums in QL
2020-12-08 16:40:29 +01:00
Tamas Vajk
6b3010e3e6
C#: Extract enum underlying type from IL
2020-12-08 16:40:29 +01:00
Tamas Vajk
c7d6c42851
C#: Add underlying enum type test for CIL extraction
2020-12-08 16:40:29 +01:00
Tamas Vajk
d140b0121a
C#: Improve array argument CIL extraction for attributes
2020-12-02 16:51:45 +01:00
Tamas Vajk
636ff2d76e
C#: Add CIL attribute tests
2020-12-02 16:51:45 +01:00
Tom Hvitved
28607927ee
C#: Update CIL tests
2020-10-28 10:57:01 +01:00
Tom Hvitved
de4ed59f62
C#: Simplify toString() for CIL entities
2020-10-27 20:58:40 +01:00
Tom Hvitved
6c5b30d2a4
C#: Update CIL consistency test
2020-09-11 11:49:07 +02:00
Tom Hvitved
d17f88bbcd
C#: Remove assembly prefix from all extractor IDs
2020-09-02 10:52:04 +02:00
Tom Hvitved
d39a33655f
C#: Fix false-positives in cs/dereferenced-value-may-be-null
...
Dereferencing an expression of a nullable type should only be reported when
the expression is not clearly non-null.
2020-07-28 16:27:36 +02:00
Tom Hvitved
a344707baa
C#: Add more data flow tests
...
Add tests that exhibit missing type pruning.
2019-12-10 15:46:31 +01:00
Calum Grant
051dd6b3dc
C#: Update qltests.
2019-11-14 17:14:51 +00:00
Calum Grant
9715d8849a
C#: Disable a CIL consistency check that seems to be invalid.
2019-11-08 16:50:51 +00:00
Calum Grant
4e2e64e949
C#: Fix up CallableReturns tests.
2019-11-08 16:42:22 +00:00
Calum Grant
b9ba534bcb
C#: Update qltest output.
2019-10-24 11:06:34 +01:00
Tom Hvitved
3e716bf806
Merge pull request #1749 from calumgrant/cs/extractor-tidy
...
C#: Refactor extractor trap generation code
2019-08-30 15:44:35 +02:00
Calum Grant
b776421602
C#: Fix up tests. Fix cil_class, and add locations for constructed methods and types.
2019-08-30 10:11:01 +01:00
Tom Hvitved
c5d9d74c0a
C#: Nested field flow
2019-08-23 09:25:05 +02:00
Jonas Jensen
11583b69e0
C#: Use pyrameterized modules for TaintTracking
...
To keep the code changes minimal, and to keep the implementation similar
to C++ and Java, the `TaintTracking{Public,Private}` files are now
imported together through `TaintTrackingUtil`. This has the side effect
of exposing `localAdditionalTaintStep`. The corresponding predicate for
Java was already exposed.
2019-08-20 13:45:38 +02:00
Tom Hvitved
481bf77d5f
CIL: Speedup consistency tests
...
- Make `InstructionViolation` abstract to avoid computing `getInstructionsUpTo()`
for all instructions in the database.
- Enable `consistency.ql`, which reports all consistency violations, and remove
all other specialized tests.
2019-06-27 13:40:07 +02:00
semmle-qlci
f58c7cc79c
Merge pull request #1446 from hvitved/csharp/cached-stages
...
Approved by calumgrant
2019-06-27 08:03:24 +01:00
Tom Hvitved
51d093add0
C#: Address review comments
2019-06-25 17:01:48 +02:00
Tom Hvitved
a1d7382a67
C#: Update expected test output
2019-06-17 20:07:54 +02:00
Tom Hvitved
0ee5fe88d9
CIL: Account for multiple VariableUpdate::getSource()s in nullness analysis
...
For methods compiled without optimization (and possibly also with optimization),
it is possible for a variable update to have multiple possible assigned values.
For example, the non-optimized CIL for
```
return cond ? null : "not null"
```
is
```
0: nop
1: ldarg.0
2: ldfld cond
3: brtrue.s 6:
4: ldstr "not null"
5: br.s 7:
6: ldnull
7: stloc.0 L0 // stores either `null` or "not null"
8: br.s 9:
9: ldloc.0
10: ret
```
Consequently, an existential in `CallableReturns.qll` must be a `forex`.
2019-05-28 10:13:00 +02:00
Tom Hvitved
4fc61ebbf3
C#: Add tests for maybe-null CIL methods
2019-05-28 10:05:33 +02:00
Tom Hvitved
6c182564e7
C#: Adjustments to CIL/nullness analyses
...
- Cache predicates in the same stage using a cached module.
- Introduce `DefUse::defUseVariableUpdate()` and use in `CallableReturns.qll`.
The updated file `csharp/ql/test/library-tests/cil/dataflow/Nullness.expected`
demonstrates why this is needed.
- Utilize CIL analysis in `Guards::nonNullValue()`.
- Analyze SSA definitions in `AlwaysNullExpr`, similar to `NonNullExpr`.
2019-03-22 15:11:31 +01:00
calum
449e65d467
C#: Update expected outputs.
2019-03-19 15:11:19 +00:00