Siegfried Pammer
3865b31fea
Move LocalFunctionDecompiler.GetStatement to Block.GetContainingStatement
6 days ago
Siegfried Pammer
51522c4487
Fix #3190 : NRE in YieldReturnDecompiler
3 months ago
Siegfried Pammer
03aecf047d
Add VariableScope and rework AssignVariableNames step to support renaming parameters of nested ILFunctions in the future.
3 months ago
Siegfried Pammer
f0f95efa05
Fix StateRangeAnalysis to handle changes in yield return codegen in Roslyn 4.13.
4 months ago
Siegfried Pammer
6cee0cdc4b
Fix #3258 : Move GraphVizGraph and friends to ILSpy and remove InternalsVisibleTo.
11 months ago
Daniel Grunwald
38e7ab4373
Fix #3110 : Add support for MCS 2.6.4 pinned region with array variable
...
* Added additional code to remove the conv instruction present in the initialization part of the pinned region.
* Extended the code responsible for removing the unpin stloc to correctly match the inverted condition found in MCS 2.6.4 compiled code.
* Enabled already present correctness test to run for MCS 2.6.4.
This is a more generalized version of the fix on PR #3110 proposed by @ElektroKill .
1 year ago
Siegfried Pammer
969e3e546a
Add support for switch on (ReadOnly)Span<char> using a compiler-generated hash function.
1 year ago
Siegfried Pammer
ca78d4a14d
Use MetadataFile instead of PEFile in TypeSystem.
1 year ago
Daniel Grunwald
5a5be026d0
Avoid reference count temporarily dropping to zero while ConditionDetection moves instructions to other blocks.
...
This avoids recursively un-registering e.g. all LdLocs from their ILVariable.LoadInstructions, etc. (all the ILInstruction.Disconnected logic). This speeds up the example from #1193 by another factor 2.
2 years ago
Siegfried Pammer
0a2037ae1f
#3075 : Avoid processing already-transformed blocks by introducing BlockTransformContext.IndexOfFirstAlreadyTransformedInstruction, which allows us to track already transformed instructions after a block has been merged into another by ConditionDetection.
2 years ago
Siegfried Pammer
4ca9fddd6f
Fix #3069 : Reuse SwitchAnalysis instead of MatchIfElseOnCharBlock
2 years ago
ElektroKill
915c0310c4
Add support for MSC 2.6.4 pinned region with string variable
2 years ago
Daniel Grunwald
b9ce8490f5
Remove hack that prevented inlining of the first instruction in each block.
...
Now that ILReader already creates the basic blocks and BlockBuilder only arranges them in containers, this code is no longer necessary.
2 years ago
ElektroKill
8a1e8e3c6b
Make return duplication in `ControlFlowSimplification` less aggressive
2 years ago
ElektroKill
0cbd9a4faa
Add Visual Basic symbolic execution option which ignores overflow checks
2 years ago
ElektroKill
29eb31354b
Fix formatting
2 years ago
ElektroKill
b110d5c2dc
Implement support for Visual Basic yield return state machines
2 years ago
ElektroKill
341074aa58
Extend VBPretty Async test code
3 years ago
ElektroKill
5d3f9d3a6f
Add support for Visual Basic async await state machine decompilation
3 years ago
Siegfried Pammer
6766ad0c59
#2823 : Introduce `IType.GetDefinitionOrUnknown()` to allow better detection of async state-machines involving unknown types.
3 years ago
Daniel Grunwald
503048b314
Prevent the early ILInlining pass from creating `addressof` instructions
3 years ago
Daniel Grunwald
3c847b56a2
Fix decompilation of async streams compiled with Roslyn 4.2
3 years ago
Siegfried Pammer
4c1931d5c6
Fix NRT warning in GetBlockStateSetMappingForLeave.
3 years ago
Siegfried Pammer
a4e2bd7f8f
Handle leave instructions in state-range analysis.
3 years ago
Siegfried Pammer
84c15bb24f
Fix #2652 : AwaitInFinallyTransform: ILAst must form a tree
3 years ago
Siegfried Pammer
3c2e52854e
DetectPinnedRegions: Inline the stack-slot involved in CustomRefPinPattern so that the following ProcessPinnedRegion call can reuse existing unmanaged pointer variables instead of being forced to create a new variable.
3 years ago
Siegfried Pammer
f98012ec16
DetectPinnedRegions: Support special case where pinned pointer is unused and the compiler optimized out the StopGCTracking-conversion.
3 years ago
Daniel Grunwald
787621fb51
Revert "Use Nop instead of InvalidExpression to hold the "goto from catch-block to try-block" comment"
...
This reverts commit 77dcbbee86
.
4 years ago
Daniel Grunwald
cedd8a6bf6
Fix #2480 : Avoid yield-return decompilation if there are unrecognized state assignments in a finally method.
4 years ago
Daniel Grunwald
77dcbbee86
Use Nop instead of InvalidExpression to hold the "goto from catch-block to try-block" comment
4 years ago
Siegfried Pammer
1826ac031d
#2539 : Add support for yield state machine pattern used by mcs 5.x
4 years ago
Daniel Grunwald
df339e72fb
Fix DetectPinnedRegions.SplitBlocksAtWritesToPinnedLocals creating blocks without ILRange.
...
These blocks could trigger assertions if LoopDetection was creating a loop BlockContainer from them (BlockContainers have an assertion requiring an ILRange).
Closes #2533 and #2457 .
4 years ago
Daniel Grunwald
583771e012
#2533 : Fix bug in CreatePinnedRegion that could cause pinned regions to be created with the wrong entry point if the original IL had blocks in an unusual order
4 years ago
Siegfried Pammer
e1ca4db851
Fix #2527 : Support skip locals init
4 years ago
Siegfried Pammer
9d99ee86db
Fix #2503 : Move correct branch in the case of swapped jump-table conditions.
4 years ago
Daniel Grunwald
109b6d073a
Allow detecting exit points across multiple levels of containers.
4 years ago
Daniel Grunwald
a716828065
Remove redundant code from RemoveRedundantReturn.cs
4 years ago
Daniel Grunwald
685a79dc31
DetectExitPoints: introduce exit points for loops+switch
...
This allows reverting the changes to HighLevelLoopTransform+ReduceNestingTransform from the previous commit, which fixes a bug in loop detection (the previous commit did not handle loops where the loop BlockContainer didn't have a Block as parent).
4 years ago
Daniel Grunwald
6757295b3b
Fix #2379 : Keep `return` statements around in original form for ConditionDetection, only transform to fall-through block-exit at the end of the transform pipeline.
...
This fixes an issue where `return` statements within try-blocks could turn into `goto` statements.
4 years ago
Daniel Grunwald
407ec6be5b
Adjust AsyncAwaitDecompiler to Roslyn 3.9.0.
4 years ago
Siegfried Pammer
7211587b45
Fix #2366 : NRE in AwaitInCatchTransform.MatchAwaitCatchHandler() and pattern errors when dealing with a switch-based jump table in AwaitInCatchTransform
4 years ago
Siegfried Pammer
76227af89d
Fix #1749 , fix #2339 , fix #2353 : Add support for rethrow in async exception handlers, fix await catch/finally patterns for complex methods.
4 years ago
Daniel Grunwald
eec24ee6bb
Fix #2311 : Handle additional `comp` instruction in `IsNullSafeArrayToPointerNotNullBlock`
4 years ago
Daniel Grunwald
0e1c24464f
Fix #2148 : Don't attempt to detect `fixed` statement for pinned value types
5 years ago
Daniel Grunwald
3d10509b1b
Add SparseIntegerSwitch option.
5 years ago
Daniel Grunwald
b035ec1960
Fix #2129 : be more flexible about the initialization order for the async state machine.
5 years ago
dotnet format
0d9f871a4f
#2128 : Reformat the whole code base.
5 years ago
Siegfried Pammer
a6bbccae8d
Fix #2123 : switch on string detection:
...
1) Do not remove switchValueVar, if it is used elsewhere.
2) Support empty case blocks in SimplifyCascadingIfStatements transform
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