Siegfried Pammer
2403548ce3
Add tests for C# 9.0 lambda parameter discards
5 years ago
Daniel Grunwald
1a997fdb60
Enable aggressive inlining into switch expressions.
5 years ago
Daniel Grunwald
abb9d49a0f
Add support for C# 8 switch expressions.
5 years ago
Siegfried Pammer
4b865c27e4
Fix #2076 : VS AddIn opens reference assembly.
5 years ago
Siegfried Pammer
c9df069526
Add minimal test case + DecompilerSettings.Deconstruction setting
5 years ago
Siegfried Pammer
33bc9fbef4
Fix display of generic type parameters of local functions in tooltips
5 years ago
Siegfried Pammer
a231ab54d4
Add test cases
5 years ago
Daniel Grunwald
c647016bfb
#2070 : Allow `PickExitPoint` heuristic to choose a `return;`/`yield break;` that is part of a condition block.
5 years ago
Daniel Grunwald
28612d2a04
Update to Roslyn 3.7.0-4.final
5 years ago
Daniel Grunwald
1b2874eb5d
Use `nint` type for local IntPtr variables if arithmetic is performed on them.
5 years ago
Daniel Grunwald
1d684102ac
Support compound assignment for native integers.
5 years ago
Daniel Grunwald
59be020dea
Fix pointer arithmetic with `nint*`/`nuint*`.
5 years ago
Daniel Grunwald
dc3dd193c8
Support unary operators on native integers.
5 years ago
Daniel Grunwald
a7826e399e
Fix native integer shifts.
5 years ago
Daniel Grunwald
3a4db502bc
Add support for arithmetic using C# 9 native integer types.
5 years ago
Daniel Grunwald
5a8cfc25ba
Add some tests for native integers.
...
The conversion roundtrip tests are disabled due to https://github.com/dotnet/roslyn/issues/45929
5 years ago
Daniel Grunwald
2c9b84a1e1
If possible, use nint/nuint for conversions to/from IntPtr.
5 years ago
Daniel Grunwald
450fae49e3
Introduce nint/nuint types and their conversions in the type system
5 years ago
Daniel Grunwald
62fcab8d99
#2050 : Allow inlining into the StObj target slot when this is possible without changing the program semantics.
5 years ago
Daniel Grunwald
d8e837ef47
Fix #1772 : Support EnumeratorCancellationAttribute
...
With this change, the async decompiler no longer gets confused by the logic disposing `this.<>x__combinedTokens`.
5 years ago
Daniel Grunwald
c0b1119fab
Use C# 8.0 to build ILSpy.
5 years ago
Daniel Grunwald
345b65511c
Update to Roslyn 3.7.0-2.final for tests.
5 years ago
Daniel Grunwald
925a4e1e65
#2050 : Don't put ldflda/ldelema with immediate exceptions into StObj.TargetSlot.
...
The C# translation of StObj will always apply delayed exceptions in these two cases, so putting an instruction with delayed exceptions in that slot would change program semantics.
5 years ago
Daniel Grunwald
a0b144d332
Use `Unsafe.AsPointer()` for `ConversionKind.StopGCTracking`.
5 years ago
Daniel Grunwald
35c405b973
Translate the initializer of a `fixed` statement as managed reference and only apply the ref-to-pointer conversion at the end.
...
This way we create compilable code when the pinned variable type does not match the initializer type.
5 years ago
Daniel Grunwald
a9d643b208
Emit a call to `ref Unsafe.As<TFrom, TTo>(ref TFrom)` when the IL code contains a mismatch of managed reference types.
...
The previously emitted `ref *(TTo*)(&source)` only compiles when `source` is a local variable; otherwise C# complains about the memory not being pinned.
Note that we special-case local variables to keep the previous behavior around; this avoids pulling in `System.Runtime.CompilerServices.Unsafe.dll` when it's unnecessary.
5 years ago
Daniel Grunwald
2c0554f129
Fix #1963 : Support decompiling `calli` instructions into C# 9 function pointer syntax.
5 years ago
Siegfried Pammer
be8c83e1a4
Disable Test9
5 years ago
Daniel Grunwald
80063e3c15
Fix TDCU's version of copy propagation being too aggressive.
5 years ago
Chicken-Bones
e0e26a0e77
Fix ReduceNestingTransform when extracting default block of switch in a try container
5 years ago
dymanoid
bfb57da93b
Implement project writer for SDK style projects
5 years ago
dymanoid
fdef5d11c6
Rearrange project writing logic
...
The WholeProjectDecompiler shall not have too many responsibilities.
5 years ago
dymanoid
b492a20442
Move assembly resolution logic to better place
...
WholeProjectDecompiler shall not care about checking whether an assembly
is in GAC.
5 years ago
dymanoid
a952cda502
Create dedicated namespace for project decompiler
5 years ago
Siegfried Pammer
fcc910cb4d
Cleanup and refactoring after code review
5 years ago
Siegfried Pammer
358d677084
#1798 : Add more unit tests
5 years ago
Siegfried Pammer
d4fd92bf0f
Fix initializer block detection of display structs.
5 years ago
Siegfried Pammer
b114734128
Add Mode.UnconstrainedType and implement TransformNullPropagationOnUnconstrainedGenericExpression using TryNullPropagation.
5 years ago
Daniel Grunwald
b7754cdf5c
Workaround dotnet/roslyn#43659 in decompiled code.
5 years ago
Daniel Grunwald
c1265ad830
Fix #1946 : Don't move `return` into `try` block when doing so changes the semantics of a `finally` block.
5 years ago
Daniel Grunwald
2665d800d0
Update test to Roslyn 3.6.0-3.final.
5 years ago
Daniel Grunwald
1926756cfa
Handle the special cases where the range does not have a start or endpoint.
5 years ago
Daniel Grunwald
0dd75d6852
Add support for slicing using C# 8 ranges.
5 years ago
Daniel Grunwald
dc38355e12
Support `list[^idx]`.
...
Here the C# compiler does not actually create a `System.Index` instance, but instead compiles to `list[list.Count - idx]`.
5 years ago
Daniel Grunwald
12226c5f90
Add support for indexing a container with a System.Index instance.
5 years ago
Daniel Grunwald
748c54a1c1
Support array slicing.
5 years ago
Daniel Grunwald
dc6e094a30
Add support for indexing arrays using System.Index
5 years ago
Daniel Grunwald
4846feb640
Add support for C# 8 range syntax.
...
This initial commit only handles the trivial case where an Index or Range object is constructed.
The TODO portions of the test case show there are plenty of cases where where the C# compiler emits more complex code patterns that will require ILAst transforms.
5 years ago
Daniel Grunwald
5ad7ee0cea
Fix #1629 : Add support for `[module: NullablePublicOnly]`
...
If this attribute is in use, private/internal members lack nullability annotations.
Previously in such cases, we ended up inheriting the nullability from the `[NullableContext]`, which could cause us to display a misleading nullability for primary methods.
In debug builds, it could also trigger an assertion when trying to apply the "nullable reference type" marking to to value types.
Of note is that properties and events are a special case: they do not explicitly store Accessibility in metadata. For properties computing the accessibility requires decoding the signature (to find overridden base properties). So these two only check the declaring type's accessibility instead; private properties may still carry nullability despite `[NullablePublicOnly]`. However, the property accessors won't store nullability, so we need to read the `returnTypeAttributes` from the property itself.
5 years ago
Siegfried Pammer
199d38b85a
Add more test cases
5 years ago