Siegfried Pammer
753f1d2481
Fix #1924 : don't undo the compiler's &&-to-& optimization
...
ExpressionBuilder printed bitwise & / | on booleans as && / || whenever
the right-hand side was pure, but Roslyn lowers && / || to & / | only
when the right operand is a bare local or parameter read
(LocalRewriter.MakeBinaryOperator, unchanged since 2014). Shapes like
(c == 'a') | (c == 'b') can therefore only originate from a bitwise
source operator, yet were shown as short-circuiting. Per the discussion
in #1545 , show the operator the IL actually uses instead of guessing the
source form: the reversal is dropped entirely, so Roslyn-compiled
"a && b" now decompiles to "a & b", which recompiles to the same IL.
Assisted-by: Claude:claude-fable-5:Claude Code
2 months ago
Siegfried Pammer
77d9ee73e9
Fix IDE2000 globally
9 months ago
Siegfried Pammer
126e870a5a
Fix #3577 : Properly infer the switch governing type and preserve conversions
11 months ago
Peter Crabtree
e1e16b64f5
dev: Strip BOM mark from text files
1 year ago
Siegfried Pammer
f673b7caa2
Add support for using different editions of .NET in unit tests
1 year ago
Siegfried Pammer
e1e2f739f6
Fix switch-on-string transform for optimized Roslyn.
2 years ago
Siegfried Pammer
efbefd0d3b
Fix #3361 : switch-value conversion was losing its target type.
2 years ago
Siegfried Pammer
a94d66561a
Move to .NET 8.0 ( #3119 )
...
* Basics of net8.0. Breaking unit tests expected.
* Missed that TestRunner project was already upgraded to net7.0 (search and replace fail)
* Use Preview 6 locally
* Use .NET 8.0 RTM
* Final fixups
---------
Co-authored-by: Christoph Wille <christoph.wille@gmail.com>
3 years ago
Siegfried Pammer
70616b301c
Implement support for C# 11 switch on (ReadOnly)Span<char>.
3 years ago
Siegfried Pammer
a3191f19e2
Fix #2763 : Improve decompilation of switch-on-enum by preserving enum type information when inlining local variables into SwitchInstruction.Value.
4 years ago
Siegfried Pammer
f29205448b
Fix #2283 : Disallow all implicit conversions in switch on string.
6 years ago
Siegfried Pammer
63ca748b9a
Fix #2283 : string.to.int instruction entails a conversion to string of the input value
6 years ago
Daniel Grunwald
6951ccb1a2
Fix #2260 : switch(string) transform: handle empty cases where the C# compiler optimizes out the `if`
...
e.g.
```
switch (<PrivateImplementationDetails>.ComputeStringHash(text2))
{
case 1288728352u:
_ = text2 == "rowno";
break;
...
```
6 years ago
Siegfried Pammer
cc19e9043e
Fix #603 : Single element arrays should not span multiple lines
...
Fix #1079 : CSharpFormattingOptions.AutoPropertyFormatting has no effect
6 years ago
dotnet format
0d9f871a4f
#2128 : Reformat the whole code base.
6 years ago
Siegfried Pammer
9a77a80e3c
Fix #1767 : Fix detection switch-on-string that uses leave instead of branch instructions.
7 years ago
Siegfried Pammer
cc3a0bef7e
Fix #1745 : Empty string is missing from switch result
7 years ago
Daniel Grunwald
7a5d8af57d
#1691 : Further improvements for decompiling the new VS 2019.3 string concatenation IL pattern
7 years ago
Siegfried Pammer
05454bd741
Fix SwitchOnStringTransform.SimplifyCascadingIfStatements: do not remove statements unrelated to switch pattern.
7 years ago
Siegfried Pammer
bbb40ecb32
Fix #1602 : Recognize Roslyn empty string case block.
7 years ago
Siegfried Pammer
def681ccdf
Fix #1621 : Add AllowUnreachableCases in switch analysis.
7 years ago
Siegfried Pammer
7671ac6fe4
Fix switch on nullable for Roslyn. Ignore switch on bool because it is indistinguishable from if (bool).
8 years ago
Siegfried Pammer
b9f179465d
Fix part 1 of #1292 : switch on string inside try-block not recognized.
8 years ago
Chicken-Bones
481e05eabb
Better shortcircuit detection to avoid single condition switch statements
8 years ago
Chicken-Bones
d8244e347b
Select outer-loop continue branches as break targets for switches in nested loops
8 years ago
Chicken-Bones
d86f4b4132
Prefer simple if statements over switch with single case block
8 years ago
Chicken-Bones
52a279f861
Restore HighLevelLoopTransform pattern match for loop contents within if body
8 years ago
Chicken-Bones
7017d998d0
Improve switch decompilation in loops via early detection of continue blocks.
8 years ago
Chicken-Bones
1a021635cc
Fix detection of switch statements with cases containing a single break;
...
Remedy incorrect assumption that the default case was special.
8 years ago
Chicken-Bones
cb4fa90545
Add IL ordering based hint to UseCSharpSwitch
8 years ago
Chicken-Bones
62b2ad4f8d
Improve UseCSharpSwitch to reduce over-aggressive use of switch producing poor quality code.
8 years ago
Chicken-Bones
9a3914fca9
Handle roslyn generated sub instructions in partitioned C# switch statements
8 years ago
Siegfried Pammer
5dd7eaf129
Fix #1093 : Remove usage of type or this qualifiers, when possible.
9 years ago
Siegfried Pammer
eac591a7d7
Fix #1084 : Decompiling constants of the target type
9 years ago
Siegfried Pammer
16c900ebfa
Remove sequential values from enum members + display powers of two (- 1) as hex.
9 years ago
Siegfried Pammer
5ee6d88ff3
Add foreach over array pattern.
9 years ago
Siegfried Pammer
9630acd8b7
SwitchOnNullableTransform: Fix another special case produced by the Roslyn compiler.
9 years ago
Siegfried Pammer
086325afdf
Fix #917 : InvalidCastException: Cast from Int64 to Boolean not supported.
9 years ago
Siegfried Pammer
d6d7020893
Add test cases for nullable switch
9 years ago
Siegfried Pammer
7ae44fcdc6
Add FlattenSwitchBlocks transform + update test cases.
9 years ago
Siegfried Pammer
c2761b0e02
Update test cases for switch.
9 years ago
Siegfried Pammer
67272e58ef
SwitchOnStringTransform: Remove extra variables introduced by switch pattern.
9 years ago
Siegfried Pammer
4927de647b
Add more switch pretty test cases
9 years ago
Siegfried Pammer
f2ee1c55f9
Add test case for switch without default + remove empty default sections in StatementBuilder.
9 years ago
Siegfried Pammer
51d13bfefe
Add transform for Roslyn Switch-On-Nullable
9 years ago
Siegfried Pammer
0fa58c3d53
Fix #567 : switch statement not properly decompile
9 years ago
Siegfried Pammer
945ebc7702
Add test cases for switch on int?
9 years ago
Siegfried Pammer
930d142a62
Fix bug in SwitchOnStringTransform introduced by 9719926b6bc1e43c9d43d811e5c27d9e797209b8: Ignore exit instruction if condition is not inverted. Otherwise we need a special case for br and leave.
9 years ago
Siegfried Pammer
9719926b6b
Fix some more bugs in SwitchOnStringTransform
9 years ago
Siegfried Pammer
2145543ada
Add Switch pretty tests
9 years ago