Siegfried Pammer
b1b49b5a56
Fix bugs in foreach deconstruction and deconstruction declaration, if the same variable is used multiple times.
5 years ago
Siegfried Pammer
3390d3849d
Added support for `var (a, b, _) = ...;` syntax in deconstruction.
5 years ago
Siegfried Pammer
dab70964a5
Add support for C# 8.0 disposable ref structs
5 years ago
Siegfried Pammer
c9f5e5dd33
Refactor ForeachStatement to support deconstruction
5 years ago
Daniel Grunwald
abb9d49a0f
Add support for C# 8 switch expressions.
5 years ago
Siegfried Pammer
18ace00266
Refactor LocalFunctionDeclarationStatement + LocalFunctionMethod
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
Siegfried Pammer
9f0ca09e56
Fix #2033 : Wrong place for variable declaration.
6 years ago
Siegfried Pammer
8925b4ff7b
Inline variable declarations/modernize parts of our code base.
6 years ago
Siegfried Pammer
ba5c645257
Add TryCatchHandler annotation to CatchClause
6 years ago
Siegfried Pammer
e748e71b56
Implement workaround for #1961
6 years ago
Siegfried Pammer
5d622056a1
Add TranslatedStatement: require that C# statements must be annotated with their corresponding ILInstructions.
6 years ago
Siegfried Pammer
b953d6e8d0
Fix potential NRE in StatementBuilder.TryCatch
6 years ago
Siegfried Pammer
9e89384916
Make NumberOfCompilerGeneratedGenerics immutable and rename to NumberOfCompilerGeneratedTypeParameters
6 years ago
Daniel Grunwald
eb2a9e6b94
#1852 : Rename array.to.pointer opcode to get.pinnable.reference.
6 years ago
SilverFox
5e6fecebf5
Rework support for generic local function, and fix tests `LocalFunctions.Generic.Test_CaptureT` and `LocalFunctions.Generic.TestGenericArgs`
6 years ago
SilverFox
6409fe945c
Add support for static local function
6 years ago
SilverFox
f039705704
Add support for generic local function
6 years ago
Siegfried Pammer
64b9511aca
#1749 : Represent multi-instruction BlockContainers in expression-context as inlined delegate invocation.
6 years ago
David Wengier
e30e08a59d
The resource expression is always needed regardless of the setting.
6 years ago
David Wengier
3aebec96f5
Fix NullReferenceException when foreach decompilation is turned off
6 years ago
Daniel Grunwald
80cb24d180
Fix #1709 : NullPropagationTransform.IsGetter on generic types
6 years ago
Siegfried Pammer
c7f98a4db7
Add support for await using statements.
6 years ago
Daniel Grunwald
c56714c607
Fix assertion with async lambdas; fix async local functions.
6 years ago
Daniel Grunwald
0a54a93be0
Relax foreach transform to allow stack slots as foreach-variable again.
6 years ago
Daniel Grunwald
856cedc95e
#1456 : add test case; add additional checks to ensure we only transform normal locals into using/foreach-locals
6 years ago
Daniel Grunwald
beed6b5e24
Remove MarkGeneratedVariables() step in AsyncAwaitDecompiler.
...
This was left-over from earlier versions; but ILSpy stopped caring so much about variable vs. stack slot since Roslyn started to optimize more aggressively.
The change of variable type caused problems for debug information and could even cause an assertion.
Closes #1456 , closes #1562 .
6 years ago
Daniel Grunwald
5a8796c05c
Reuse the existing TSAB.
6 years ago
Siegfried Pammer
37e14f43e3
Refactor/Clean up local functions representation in type system.
6 years ago
Siegfried Pammer
0719aa9f08
Enable DecompilerSettings.IntroduceLocalFunctions
6 years ago
Siegfried Pammer
b83cb41f2e
Add pretty tests for local functions.
6 years ago
Siegfried Pammer
305b47245e
Refactor representation of local functions in ILAst.
6 years ago
Siegfried Pammer
8d1522f387
Transform display classes used in local functions.
6 years ago
Siegfried Pammer
bd77b8301f
Basic implementation of local functions.
7 years ago
Daniel Grunwald
961923f4fd
#1499 , #1240 : Translate pointer arithmetic on managed pointers (ref T) using the System.Runtime.CompilerServices.Unsafe intrinsics
7 years ago
Daniel Grunwald
a5505ab00d
Expose IMethod.AccessorKind. This makes it easier to determine if a method is a setter, particular in generic classes where "m.AccessorOwner?.Setter == m" ended up being wrong.
7 years ago
Siegfried Pammer
54ff546221
Fix deactivated Generics pretty tests: remove redundant boxing conversion from is-expressions.
7 years ago
Daniel Grunwald
6a47826fe2
Add sequence point on closing brace if there's an implicit void return.
7 years ago
Daniel Grunwald
2eafa0c695
Fix #1389 : Translation of "isinst" was incorrect for value types was causing an assertion.
7 years ago
Siegfried Pammer
deeb603fd7
Fix #1395 : do-while loop missing entry-point label.
7 years ago
Daniel Grunwald
e041454987
Add pretty tests for "yield return" and fix some minor bugs:
...
* remove redundant casts on yield-return-expression
* keep variable name from metadata for foreach loops
* fix 'yield break;' in nested try-finally sometimes causing a decompiler error
7 years ago
Siegfried Pammer
fbb3f230d0
StatementBuilder: do not insert continue statement at end of loop, if it's already present.
7 years ago
Siegfried Pammer
e00e7b691a
Move memcpy/memset comments before statement.
7 years ago
Daniel Grunwald
dd5845e83d
Support short-circuiting operators with dynamic. (e.g. "if (x.A && x.B)" where "x" is dynamic)
7 years ago
Siegfried Pammer
57597caf1f
Fix #1227 : System.InvalidCastException: Cast from Int64 to Empty not supported.
7 years ago
Daniel Grunwald
b396d203bd
Merge IDecompilerTypeSystem with ICompilation.
7 years ago
Daniel Grunwald
796612209d
Fix #1147 : Use C# 7.3 syntax for ref reassignment.
7 years ago
Siegfried Pammer
4540b93e19
Use ArgumentOutOfRangeException or BadImageFormatException in switch-default sections.
7 years ago
Daniel Grunwald
64547de4a0
foreach loops now use "var" if the element type is a tuple and can be inferred from the collection type.
...
Additionally, the tuple element names inferred from the collection type are now used when translating the foreach body.
8 years ago
Siegfried Pammer
b44a725eaa
Fix type of foreach variable
8 years ago