Daniel Grunwald
42eafb587f
Fix #684 : Improve detection of variable type for stack slots.
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
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
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
Siegfried Pammer
f10ab69328
Improve local-function detection to minimize false positives.
6 years ago
Siegfried Pammer
a109b77858
Refactor LocalFunctionDecompiler to allow mutually recursive local functions to be decompiled correctly.
6 years ago
Siegfried Pammer
b7bf6b7720
Fix build again.
6 years ago
Daniel Grunwald
5a8796c05c
Reuse the existing TSAB.
6 years ago
Siegfried Pammer
dc74e4ee9d
Fix build.
6 years ago
Siegfried Pammer
763ea38644
Clean up CallBuilder.HandleDelegateConstruction
6 years ago
Siegfried Pammer
647f4fd545
Do not crash if the local function was not correctly transformed. This should only happen for generic local functions, which are currently not supported.
6 years ago
Siegfried Pammer
37e14f43e3
Refactor/Clean up local functions representation in type system.
6 years ago
Daniel Grunwald
ccdabf2325
Fix a bunch of XmlDoc compiler warnings.
6 years ago
Siegfried Pammer
0719aa9f08
Enable DecompilerSettings.IntroduceLocalFunctions
6 years ago
Daniel Grunwald
b32cae412a
Eliminate BlockKind.PostfixOperator.
...
We can now represent all compound assignments using the CompoundAssignInstruction, including those on local variables.
Closes #1583 .
6 years ago
Daniel Grunwald
f2151972a0
Redesign CompoundAssignmentInstruction to support an 'Address' mode where we don't implicitly turn an LdObj into an StObj, but instead directly operate on an address.
...
This means we can get rid of the special case in TransformDisplayClassUsage, as compound.assign can now also be used with the address of a local variable.
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
89a50e64fc
Extension method syntax on lambda expressions/delegates is not allowed.
6 years ago
Siegfried Pammer
16d6e16da7
Add support for local function references and recursive local functions.
6 years ago
Siegfried Pammer
7d95516e85
Fix #1518 : Missing Detach()-call in AST manipulation.
6 years ago
Siegfried Pammer
6338bd1b85
Partially revert CheckNoNamedOrOptionalArguments.
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
d841d96406
Fix unnecessary casts when calling user-defined operators on nullable types.
6 years ago
Siegfried Pammer
8d1522f387
Transform display classes used in local functions.
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
03e45fc80a
Fix #1568 : Mimic behavior of ILReader.CreateILVariable in case of empty parameter names of anonymous methods.
6 years ago
Siegfried Pammer
5a2302089b
Refactor TransformDisplayClassUsage into separate transform.
...
Make display class detection pattern-based instead of name-based. Fixes #1554
6 years ago
Siegfried Pammer
bd77b8301f
Basic implementation of local functions.
6 years ago
Daniel Grunwald
4e173cc885
Improve error message on decompiler crashes
6 years ago
Daniel Grunwald
fe4a80ec6c
Fix InvalidOperationException in TSAB.MakeFieldReference() when a System.Math field could not be found
6 years ago
Daniel Grunwald
ef035e6e02
Use ".data cil" if data is in text section.
6 years ago
Siegfried Pammer
bb10f5a6a6
Fix #1528 : Show default value of nullable parameters as null.
6 years ago
Siegfried Pammer
5a692610ff
Fix #1523 : Search throws EnumUnderlyingTypeResolverException
6 years ago
DEVB\darius.kucinskas
aeeaa5c149
Fixed crash then type is null in type def matches.
6 years ago
Siegfried Pammer
905081ee37
Fix #1473 : Handle default values for 'Prefer32Bit' correctly.
6 years ago
Siegfried Pammer
c461bb3ccb
WholeProjectDecompiler: store framework version number as padded integer for future use.
6 years ago
Siegfried Pammer
09c6c70879
Ignore empty resources in WholeProjectDecompiler.
6 years ago
Siegfried Pammer
4ccfc39444
Fix #1491 : Exception on empty resource
6 years ago
Daniel Grunwald
04ffdb6da4
Fix 'ref readonly' delegates
6 years ago
Siegfried Pammer
2e00285666
Display type information of fixed fields as "Type[Length]" in tree view.
6 years ago
Siegfried Pammer
09ea089d8a
Fix #1499 , fix #1502
6 years ago
Siegfried Pammer
983b7e5280
Add test-case for #1462
6 years ago