Siegfried Pammer
eea4b7701c
#2098 : CallBuilder: Fix named argument handling in TI
5 years ago
Daniel Grunwald
f5409ebe31
Fix re-pinning getting confused about which variant of the pinned local to use when the new re-pinned reference depends on the old pinned reference.
5 years ago
Daniel Grunwald
4b716e2db5
Fix #2056 : "remove branch into body" must be executed before the clone cleanup
...
Otherwise the to-be-removed branch could keep an soon-to-be-unreachable block alive outside the pinned region.
5 years ago
Daniel Grunwald
c9f65d3b5e
Fix #1555 : Eliminate value-type temporaries emitted by mcs on field reads.
5 years ago
Daniel Grunwald
bd4e565b93
Ensure all pinned regions variables are converted to VariableKind.PinnedRegionLocal
5 years ago
Daniel Grunwald
ddff831cf0
#1292 : Fix some more problems with pinned locals.
...
Let's distinguish between the original pinned locals and the PinnedRegion locals.
The format need declarations if any are left over after transformations; the latter don't.
5 years ago
Siegfried Pammer
e7d49b2305
Fix #2079 : Allow variables generated from state-machine fields to be propagated in TDCU.
5 years ago
Daniel Grunwald
cc850c27aa
Add "Aggressive inlining" option
5 years ago
Daniel Grunwald
5bd47c171f
Don't require a definition for the task builder type, also accept an UnknownType.
5 years ago
Daniel Grunwald
b6b5f1e8e6
#2092 : ILFunction.Parameters / ILFunction.ReturnType should never be null.
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
8d72672e6c
Reimplement DecompilerSettings.StaticLocalFunctions (was lost in the refactoring in #2077 )
5 years ago
Siegfried Pammer
acea95d0a1
Properly rename LocalFunctionMethod.Name on all instructions
5 years ago
Siegfried Pammer
18ace00266
Refactor LocalFunctionDeclarationStatement + LocalFunctionMethod
5 years ago
Daniel Grunwald
bdea1950a8
Add `#if !NETCORE` around extension methods that are included with .NET Core 3
5 years ago
Daniel Grunwald
fc51dd17a5
Remove outdated comment. The `PickExitPoint` heuristic is no longer using "amount of code" but the IL block order.
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
2acc4339df
#2058 : Mark most transforms as public to help users that use the ILAst directly without decompiling to C#.
5 years ago
Daniel Grunwald
3409ffca25
Fix #2073 : Ensure the startOffsetVar actually appears in the expected instruction, not somewhere else.
5 years ago
Daniel Grunwald
e0fd0bba32
Allow inlining constants into expression trees.
5 years ago
Daniel Grunwald
c63e14e805
Move some special cases from ILInlining.FindLoadInNext to the individual ILInstructions.
5 years ago
Daniel Grunwald
fe2143b41f
Validate code movement performed by IndexRangeTransform.
5 years ago
Daniel Grunwald
7d3dfc3b81
Remove the hack where IndexRangeTransform looks at instructions prior to startPos.
...
Instead we now perform a partial transformation which we can then later extend.
This means we no longer need to rely on the previous instruction (prior to startPos) being already inlined.
This way the IndexRangeTransform also works without the duplicate StatementTransform pass.
5 years ago
Daniel Grunwald
1b2874eb5d
Use `nint` type for local IntPtr variables if arithmetic is performed on them.
5 years ago
Siegfried Pammer
5da3b87845
Fix #2060 : Add support for alternate code patterns in TransformDisplayClassUsage.ValidateConstructor
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
3a4db502bc
Add support for arithmetic using C# 9 native integer types.
5 years ago
Daniel Grunwald
12094a8376
Support extraction out of control-flow IfInstruction even if it isn't using a Block as TrueInst/FalseInst.
5 years ago
Daniel Grunwald
417a2c3391
Revert the InvertIf change; it causes too many issues for the following transforms.
5 years ago
Daniel Grunwald
e083d43fb9
Fix ReduceNestingTransform
5 years ago
Daniel Grunwald
016d9f8f4d
Fix #1903 : un-inline argument of unsupported `isinst` instructions.
5 years ago
Daniel Grunwald
696fdca923
Always create a block when inverting an if.
...
This keeps the ILAst more uniform and ensures extraction is possible for the code in the then statement.
5 years ago
Daniel Grunwald
b18ed89b67
#2050 : Add assertion to check that no transform uses StObj.TargetSlot incorrectly.
5 years ago
Daniel Grunwald
81d9eda332
I just discovered that we do have un-inlining implemented... let's mention it where it's more likely to be found in the future.
5 years ago
Daniel Grunwald
ef47a8bdf6
#2058 : Avoid NullReferenceException when DecompileRun is not provided.
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
Siegfried Pammer
74101ff0dc
Fix #2053 : Assert and NRE in LocalFunctionDecompiler
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
Siegfried Pammer
761c3fef14
Adapt TransformExpressionTrees to ILAst changes.
5 years ago
Siegfried Pammer
68e4d7dfa6
Adapt TransformArrayInitializers to ILAst changes.
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
2c0554f129
Fix #1963 : Support decompiling `calli` instructions into C# 9 function pointer syntax.
5 years ago
Daniel Grunwald
1f2d1660c8
#2023 : If blocks are reachable both from within the pinned region and from outside it, clone those blocks.
...
This removes an error condition where pinned variables could remain after DetectPinnedRegions, resulting in invalid C#.
The downside is that it's possible for the code size to increase exponentially when given sufficiently evil IL code.
5 years ago
Daniel Grunwald
15f638af9a
Fix decompilation of switch where default section is a leave instruction.
5 years ago
Daniel Grunwald
a6e23d1f98
Fix "case null" handling in switch(string) with current Roslyn version (3.7.0-2.final).
5 years ago
Daniel Grunwald
30da0b7525
Add some missing checks to MatchRoslynSwitchOnString
5 years ago
Daniel Grunwald
4f4ca482be
Fix #1950 : Fix crash when finallyMethod cannot be found.
...
This seems to be possible due to a C# compiler bug.
5 years ago