Daniel Grunwald
3f996ff2c0
Fix #1604 : async methods that had no 'await' but were capturing 'this' were not decompiled correctly
6 years ago
Siegfried Pammer
ce04964206
Reformat ThrowExpressions tests.
6 years ago
Daniel Grunwald
df13f0ce01
Fix #1605 : Inline ref locals more aggressively; this is necessary for VB compound assignments.
6 years ago
Daniel Grunwald
0e0179edff
Improve NullPropagation (?.) when fields of value-type are involved.
6 years ago
Daniel Grunwald
7f8689c464
Allow inlining of compiler-generated value-type-temporaries when field accesses are involved.
6 years ago
Siegfried Pammer
4a0ca21bbf
Add (failing) test case for throw expressions.
6 years ago
Daniel Grunwald
18ee984ade
Add support for "definitely assigned if true/false" to data flow analysis.
6 years ago
Siegfried Pammer
14c76d1ba6
Fix failing initializer tests.
6 years ago
Daniel Grunwald
8117dfff4a
Fix #1242 : Discard unreachable code.
...
Unreachable code is not part of the dominator tree, which most of our transforms are based on.
In particular, dominance-based loop detection runs into the problem where unreachable code might have jumps into two independent loops. In that case, it's impossible to place the unreachable code in a way that avoids assertions / generating invalid C#.
We establish the invariant that all blocks in a BlockContainer must be statically reachable from the entry point (-> every block is part of the dominator tree). This means transforms no longer have to deal with special cases for unreachable code.
The "Remove dead and side effect free code" option still has an effect on dead stores, but unreachable code is now always removed (previously this also was dependent on this option).
6 years ago
Siegfried Pammer
c51aea3601
Fix decompilation of yield return in local functions.
6 years ago
Siegfried Pammer
911a92f3f9
Basic test for ref reassignment.
6 years ago
Daniel Grunwald
d99f6c81a5
Fix #1595 : preserve C# type for field and tuple element access
6 years ago
Siegfried Pammer
36afa0857d
Add tests for ref, out and in parameters.
6 years ago
Siegfried Pammer
e9a020062d
Add more RefLocalsAndReturns pretty tests.
6 years ago
Daniel Grunwald
42eafb587f
Fix #684 : Improve detection of variable type for stack slots.
6 years ago
Daniel Grunwald
8cd8a90c22
Fix #1563 : `Unexpected return in MoveNext()` when mixed `using` and more than one `yield break`
...
Roslyn re-uses the same "this.Finally(); return v;" block for both "yield break;" instructions, so the yield break pattern needs to support multiple stores to the helper variable.
6 years ago
Daniel Grunwald
7e3b36aaa7
#1563 : Where possible, replace an explicit interface implementation call with a call to the interface member.
6 years ago
Siegfried Pammer
3d60c7bd70
Fix #1590 : Cast from override method to Delegate is not properly simplified
6 years ago
Daniel Grunwald
b75c252193
Upgrade C# 8.0 nullability support for Roslyn 3.2.0-beta4.
6 years ago
Daniel Grunwald
539e3a906d
Fix #1552 : user-defined and decimal increments
...
For user-defined increments, there were problems with Roslyn was optimizing out one of the stores.
The new transform FixRemainingIncrements now takes increments/decrements that were not detected by TransformAssignment and introduces a temporary variable that can be incremented.
This sometimes requires un-inlining via the new ILInstruction.Extract() operation.
Extract() is not supported in all possible contexts, so it is possible but unlikely that some op_Increment calls remain.
For decimals, the situation is different: legacy csc actually was optimizing "d + 1m" to "op_Increment(d)", so we can get rid of any left-over increments by undoing this optimization. This now happens in ReplaceMethodCallsWithOperators.
6 years ago
Daniel Grunwald
c56714c607
Fix assertion with async lambdas; fix async local functions.
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
Siegfried Pammer
537df7bab3
Add option: 'ref' extension methods
6 years ago
Siegfried Pammer
a109b77858
Refactor LocalFunctionDecompiler to allow mutually recursive local functions to be decompiled correctly.
6 years ago
Siegfried Pammer
763ea38644
Clean up CallBuilder.HandleDelegateConstruction
6 years ago
Siegfried Pammer
37e14f43e3
Refactor/Clean up local functions representation in type system.
6 years ago
Daniel Grunwald
33c7425fa2
Fix several bugs with compound assignments on indexers.
...
Closes #1580 .
6 years ago
Siegfried Pammer
bb066dbd04
Additional test (deactivated)
6 years ago
Siegfried Pammer
01e42b772c
Fix local functions inside lambdas.
6 years ago
Siegfried Pammer
b83cb41f2e
Add pretty tests for local functions.
6 years ago
Siegfried Pammer
89a50e64fc
Extension method syntax on lambda expressions/delegates is not allowed.
6 years ago
Daniel Grunwald
688dffff2b
Add some string.Concat()-tests
6 years ago
Daniel Grunwald
e6489d543e
Fix #1574 : When re-introducing an explicit cast for an implicit user-defined conversion; ensure we use a direct cast and don't go through the code path for builtin conversions.
6 years ago
Daniel Grunwald
3314f3f37a
Fix #1571 : Expression transforms not running for values of inline assignments.
6 years ago
Siegfried Pammer
e99bc2b145
Fix #1567 : Do not transform string.Concat method calls to + operators if named arguments are used.
6 years ago
Siegfried Pammer
0e638dcb28
Fix #1524 : Adjust expression trees transform to work with async code as well.
6 years ago
Daniel Grunwald
04ffdb6da4
Fix 'ref readonly' delegates
6 years ago
Siegfried Pammer
09ea089d8a
Fix #1499 , fix #1502
6 years ago
Siegfried Pammer
983b7e5280
Add test-case for #1462
6 years ago
Daniel Grunwald
961923f4fd
#1499 , #1240 : Translate pointer arithmetic on managed pointers (ref T) using the System.Runtime.CompilerServices.Unsafe intrinsics
6 years ago
Siegfried Pammer
7553c120a5
Fix #1497 : do not insert newlines inside string interpolation expressions.
6 years ago
Siegfried Pammer
8dc80583ec
#1485 : Fix decompilation of TypeAs with Nullable<T> in expression trees
6 years ago
Siegfried Pammer
3abb548e1e
Fix #1479 : Unable to cast object of type 'System.Int32' to type 'System.Single'
6 years ago
Siegfried Pammer
63646b0ace
Fix #1472 : Apply ExpressionTransforms after CombineExitsTransform to "canonicalize logic and/or"
6 years ago
Daniel Grunwald
b7a3c8d640
Fix #1442 : Allow "dynamic?" in the type system.
6 years ago
Daniel Grunwald
8d99af14c5
Add support for 'ref readonly' return type.
6 years ago
Daniel Grunwald
416425b681
Readonly struct method calls on readonly lvalues don't generate temporaries.
6 years ago
Siegfried Pammer
61b170463e
Add missing files.
6 years ago
Daniel Grunwald
4ad4f6a232
Fix #882 : Don't inline value-type temporaries for setter calls.
6 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.
6 years ago