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
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
dotnet format
0d9f871a4f
#2128 : Reformat the whole code base.
5 years ago
Siegfried Pammer
407c337168
Add ForStatement, DoWhileStatement and SeparateLocalVariableDeclarations settings.
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
Siegfried Pammer
c1fca21e8a
Make ILRange field private - introduce public API for IL range manipulation.
7 years ago
Siegfried Pammer
deeb603fd7
Fix #1395 : do-while loop missing entry-point label.
7 years ago
Chicken-Bones
52a279f861
Restore HighLevelLoopTransform pattern match for loop contents within if body
7 years ago
Chicken-Bones
7017d998d0
Improve switch decompilation in loops via early detection of continue blocks.
7 years ago
Daniel Grunwald
4b96f48d87
Cosmetic changes during review of PR #1176
7 years ago
Chicken-Bones
3fb7c71f8a
Improve control flow decompilation in ConditionDetection
7 years ago
Siegfried Pammer
845c620a9f
Implement UserDefinedCompoundAssign
rename CompoundAssignmentInstruction -> NumericCompoundAssign
7 years ago
Siegfried Pammer
ed8fc0de8c
Fix #968 : foreach loop with early return
8 years ago
Siegfried Pammer
69f2609bff
Fix #861 : Failure to decompile for loop with conditional early return
8 years ago
Siegfried Pammer
37474ae5e9
Fix #447 : second part ReturnFromDoWhileInTryFinally
8 years ago
Siegfried Pammer
300c9cc9a9
Do not convert while-true to while-condition loop or do-while loop, if the condition uses a variable that is captured inside the loop.
8 years ago
Siegfried Pammer
f91df96281
Improve for loop transform: split conditions
8 years ago
Siegfried Pammer
b3f5a8e089
Refactor MatchDoWhileLoop; add documentation
8 years ago
Siegfried Pammer
b24b749ec6
Add support for multiple conditions in do-while loops.
8 years ago
Siegfried Pammer
4daabf350a
Do not convert to for loop if increment variable is a parameter.
8 years ago
Siegfried Pammer
bcc574a6c0
Fix aggressive for-loop detection
8 years ago
Siegfried Pammer
86c3ab8314
Fix unit tests
8 years ago
Siegfried Pammer
b3370506ae
Fix small regressions
8 years ago
Siegfried Pammer
bfb310b4a3
Remove DetectedLoop
8 years ago
Siegfried Pammer
8da8a7f0c9
HighLevelLoopTransform: implement detection of for and do-while
8 years ago
Siegfried Pammer
af6274c5ae
HighLevelLoopTransform: Add support for while (condition) loops
8 years ago