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.
2023-10-14 23:16:57 +02:00
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).
2021-06-03 16:53:56 +02:00
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.
2021-06-02 22:40:28 +02:00
dotnet format
0d9f871a4f
#2128 : Reformat the whole code base.
2020-08-28 01:05:38 +02:00
Siegfried Pammer
407c337168
Add ForStatement, DoWhileStatement and SeparateLocalVariableDeclarations settings.
2019-12-08 09:29:19 +01:00
Daniel Grunwald
b32cae412a
Eliminate BlockKind.PostfixOperator.
...
We can now represent all compound assignments using the CompoundAssignInstruction, including those on local variables.
Closes #1583 .
2019-07-17 00:33:42 +02:00
Siegfried Pammer
c1fca21e8a
Make ILRange field private - introduce public API for IL range manipulation.
2019-02-16 20:36:17 +01:00
Siegfried Pammer
deeb603fd7
Fix #1395 : do-while loop missing entry-point label.
2019-01-26 15:12:37 +01:00
Chicken-Bones
52a279f861
Restore HighLevelLoopTransform pattern match for loop contents within if body
2018-08-14 11:21:18 +10:00
Chicken-Bones
7017d998d0
Improve switch decompilation in loops via early detection of continue blocks.
2018-08-14 11:21:17 +10:00
Daniel Grunwald
4b96f48d87
Cosmetic changes during review of PR #1176
2018-06-14 00:46:01 +02:00
Chicken-Bones
3fb7c71f8a
Improve control flow decompilation in ConditionDetection
2018-06-12 18:49:51 +10:00
Siegfried Pammer
845c620a9f
Implement UserDefinedCompoundAssign
...
rename CompoundAssignmentInstruction -> NumericCompoundAssign
2018-05-09 21:33:10 +02:00
Siegfried Pammer
ed8fc0de8c
Fix #968 : foreach loop with early return
2017-11-12 21:15:18 +01:00
Siegfried Pammer
69f2609bff
Fix #861 : Failure to decompile for loop with conditional early return
2017-11-12 20:11:17 +01:00
Siegfried Pammer
37474ae5e9
Fix #447 : second part ReturnFromDoWhileInTryFinally
2017-11-12 17:14:26 +01:00
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.
2017-11-11 03:44:00 +01:00
Siegfried Pammer
f91df96281
Improve for loop transform: split conditions
2017-11-11 03:20:56 +01:00
Siegfried Pammer
b3f5a8e089
Refactor MatchDoWhileLoop; add documentation
2017-11-10 18:25:01 +01:00
Siegfried Pammer
b24b749ec6
Add support for multiple conditions in do-while loops.
2017-11-07 23:51:20 +01:00
Siegfried Pammer
4daabf350a
Do not convert to for loop if increment variable is a parameter.
2017-11-06 00:05:21 +01:00
Siegfried Pammer
bcc574a6c0
Fix aggressive for-loop detection
2017-11-05 23:54:53 +01:00
Siegfried Pammer
86c3ab8314
Fix unit tests
2017-11-05 22:45:06 +01:00
Siegfried Pammer
b3370506ae
Fix small regressions
2017-11-05 18:28:41 +01:00
Siegfried Pammer
bfb310b4a3
Remove DetectedLoop
2017-11-05 18:17:53 +01:00
Siegfried Pammer
8da8a7f0c9
HighLevelLoopTransform: implement detection of for and do-while
2017-11-05 16:22:30 +01:00
Siegfried Pammer
af6274c5ae
HighLevelLoopTransform: Add support for while (condition) loops
2017-11-05 14:08:33 +01:00