Siegfried Pammer
50c4fa1c13
Add two more patterns with throw expressions.
6 years ago
Siegfried Pammer
1e3e8fdac1
Allow ref-locals to be initialized from nested field addresses.
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
5c18c9e945
Floating-point arithmetic isn't affected by checked/unchecked blocks; so avoid forcing it into an unchecked block.
6 years ago
Siegfried Pammer
ddf4053a45
Fix merge conflict in Conversion.cs
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
Daniel Grunwald
903544598a
Add comments about expected result after a ConvertTo() call.
...
This method has grown a few cases where it doesn't actually convert.
6 years ago
Siegfried Pammer
7d4b4c6433
Implement NullCoalescingTransform with value types.
6 years ago
Siegfried Pammer
2b6c0c3892
Fix formatting in ExpressionBuilder.
6 years ago
Daniel Grunwald
b7f0e2e929
Be less aggressive when removing dead code -- some of it may still be interesting to users.
6 years ago
Daniel Grunwald
752f0de978
Further adjustments to transforms now that copy propagation no longer runs.
6 years ago
Siegfried Pammer
2ca8c31d8e
Fix ArgumentException: ignore duplicate keys after variable splitting in TransformDisplayClassUsage
6 years ago
Daniel Grunwald
60422a0f7e
Fix ResolveResult on typeof() expression.
6 years ago
Daniel Grunwald
18ee984ade
Add support for "definitely assigned if true/false" to data flow analysis.
6 years ago
Siegfried Pammer
adc443e4e2
Fix dynamic compound assignments
6 years ago
Daniel Grunwald
97d490a3df
Slightly generalize the post-increment transform so that it no longer depends on copy propagation.
6 years ago
Daniel Grunwald
afde03a04d
Fix #1597 : Incorrect handling of nullability annotations during generic type substitution.
6 years ago
Daniel Grunwald
8cfc21dfab
Fix DefiniteAssignmentVisitor bugs handling ILFunction, and add some comments.
6 years ago
Siegfried Pammer
25f625af99
Move copy propagation after expression and statement transforms.
6 years ago
Siegfried Pammer
7d62a7e032
Reset HasInitialValue flag after TransformDisplayClassUsage.
6 years ago
Siegfried Pammer
e5f95143cf
TransformDisplayClassUsage: set HasInitialValue = true for newly introduced locals.
6 years ago
Siegfried Pammer
3067aa5519
FlattenSwitchBlocks: include local function and out var declarations in the list of exceptions.
6 years ago
Siegfried Pammer
91af32ef94
Do not wrap local functions in checked blocks.
6 years ago
Siegfried Pammer
129fd876d4
Use extension method syntax only if the extension method is eligible.
6 years ago
Siegfried Pammer
470cd1ec23
Fix SolutionCreator.GetRelativePath so that it properly handles directories with '.' in the name.
6 years ago
Daniel Grunwald
6c0216bbb9
Fix assertion in ReduceNestingTransform: after copying the exitInst, it was possible that the old copy of the exitInst became unreachable.
6 years ago
Daniel Grunwald
c4cb9df687
Fix switch in loops sometimes detecting an invalid switch body.
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
Daniel Grunwald
c3037afa70
Fix #1352 : Assertion in NullableLiftingTransform.DoLift
6 years ago
Siegfried Pammer
9c1bf7fbdf
Introduce ReferenceKind in IParameter and ByReferenceResolveResult.
6 years ago
Daniel Grunwald
c366235246
#1349 : Fix type substitution for members of unknown generic types (due to unresolved references)
...
Also, assume that unknown inputs to ldfld are temporaries, not unmanaged pointers.
This avoids emitting weird pointer casts when accessing fields on unresolved value types.
6 years ago
Siegfried Pammer
860f9db950
Extend type inference to allow ref return types.
6 years ago
Daniel Grunwald
42eafb587f
Fix #684 : Improve detection of variable type for stack slots.
6 years ago
Daniel Grunwald
abcef43dba
Fix #1532 : Display metadata token in DecompilerException error message
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
7223806967
Disable resolver log again.
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
Siegfried Pammer
61231b7725
Fix #1593 : TransformCollectionAndObjectInitializers uses nested indexer call as target of object initializer.
6 years ago
Siegfried Pammer
01b8b83360
Fix CSharpDecompiler.ReadCodeMappingInfo not taking generic lambdas into account.
6 years ago
Daniel Grunwald
c56714c607
Fix assertion with async lambdas; fix async local functions.
6 years ago
Siegfried Pammer
a63e94e5b4
Refactor Solution decompilation to use Language instead of AssemblyTreeNode.
6 years ago
Daniel Grunwald
0a54a93be0
Relax foreach transform to allow stack slots as foreach-variable again.
6 years ago