ds5678
898c2a3f9f
Add Issue3877 test and handle negative dict capacity
...
Added Issue3877 test to PrettyTestRunner and new test case source to verify dictionary initialization with negative capacity. Updated SwitchOnStringTransform to skip processing when a negative dictionary capacity is detected.
2 months ago
Siegfried Pammer
04505bbdf2
Highlight and scroll to the changed instruction in the ILAst view
...
The C# debug-steps view highlights and centers the exact AST node a
transform changed; the ILAst view already had the step tree and
replay-at-step but produced no highlight. Bring it to parity.
IL rendering has no token-writer seam like the C# output visitor, so
per-instruction text spans are recorded by bracketing
ILInstruction.WriteTo via a new INodeTrackingOutput. The dominant
inst.ReplaceWith(newInst) transform pattern detaches the instruction
passed to Step, so ILTransformContext gains EndStep to record the
produced instruction; Stepper additionally records the position's
ancestor chain as fallback candidates before the step-limit throw, so
the "show state before" view -- which halts at the selected step --
still resolves to a surviving ancestor (ultimately the ILFunction).
The highlight-range resolver is shared with the C# language.
Assisted-by: Claude:claude-opus-4-8:Claude Code
3 months ago
Siegfried Pammer
63757ead3b
Fix #3382 : Support compiler-generated throw-helper invocations in switch-expression implicit default-case.
...
Assisted-by: Claude:claude-fable-5:Claude Code
3 months ago
Peter Crabtree
e1e16b64f5
dev: Strip BOM mark from text files
1 year ago
ds5678
e4000c8a5c
Enhance null handling in switch transformations
...
- Updated `Issue3421.cs`.
- Updated `MatchLegacySwitchOnStringWithDict` to check for `leaveContainer` and handle null sections accordingly.
- Introduced an overload for `AddNullSection` to accept `ILInstruction` as the body, improving flexibility.
- Modified existing `AddNullSection` to utilize the new overload, allowing for varied body types in `SwitchSection`.
2 years ago
ds5678
cbe8dd43d7
Fix null check in MatchLegacySwitchOnStringWithDict
...
Updated the condition for `nullValueCaseBlock` to ensure it is not null and not equal to `defaultBlock`.
2 years ago
Siegfried Pammer
e1e2f739f6
Fix switch-on-string transform for optimized Roslyn.
2 years ago
Siegfried Pammer
969e3e546a
Add support for switch on (ReadOnly)Span<char> using a compiler-generated hash function.
3 years ago
Siegfried Pammer
4ca9fddd6f
Fix #3069 : Reuse SwitchAnalysis instead of MatchIfElseOnCharBlock
3 years ago
Siegfried Pammer
70616b301c
Implement support for C# 11 switch on (ReadOnly)Span<char>.
3 years ago
Siegfried Pammer
32e04eaf12
Implement Roslyn 4.6 pattern for C# switch on string: match by length and unique characters first.
3 years ago
Siegfried Pammer
35aea3eea7
Slight pattern changes in mcs 5 switch-on-string with case null.
5 years ago
Siegfried Pammer
0ed191617e
Fix #2528 : arbitrary stores preceding switch-on-string confuse the transform, making it pick the wrong variable as switch variable.
5 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
2530c9a2ce
#2182 : Do not inline switch value, in case variable is reused.
6 years ago
dotnet format
0d9f871a4f
#2128 : Reformat the whole code base.
6 years ago
Siegfried Pammer
e320819103
Formatting change: while-condition loop to do-while loop.
6 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
6 years ago
Siegfried Pammer
b27f08621f
Fix #2101 : reset removeExtraLoad flag if keepAssignmentBefore is set; implement simple case-de-duplication: abort if there are any duplicate cases.
6 years ago
Daniel Grunwald
2acc4339df
#2058 : Mark most transforms as public to help users that use the ILAst directly without decompiling to C#.
6 years ago
Daniel Grunwald
15f638af9a
Fix decompilation of switch where default section is a leave instruction.
6 years ago
Daniel Grunwald
a6e23d1f98
Fix "case null" handling in switch(string) with current Roslyn version (3.7.0-2.final).
6 years ago
Daniel Grunwald
30da0b7525
Add some missing checks to MatchRoslynSwitchOnString
6 years ago
Daniel Grunwald
832c18f0be
Fix #1809 : Support VB Select on string.
7 years ago
Siegfried Pammer
9a77a80e3c
Fix #1767 : Fix detection switch-on-string that uses leave instead of branch instructions.
7 years ago
Siegfried Pammer
0a432e23fb
Fix #1742 : Special case for case string.Empty generated by mcs.
7 years ago
Siegfried Pammer
cc3a0bef7e
Fix #1745 : Empty string is missing from switch result
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
15488acdc7
Fix #1559 : switch on string inside try block.
7 years ago
Siegfried Pammer
f7641037a2
Fix #1526 : Roslyn-optimized switch at end of method uses leave instead of br.
7 years ago
Siegfried Pammer
edcf4931d0
Fix #1489 : ArgumentNullException in SwitchOnStringTransform.SimplifyCascadingIfStatements
8 years ago
Siegfried Pammer
9c62f11e51
Add new switch(string) pattern for Roslyn.
8 years ago
Siegfried Pammer
80bc89f606
Fix SwitchOnStringTransform.SimplifyCascadingIfStatements to handle newer Roslyn code-gen correctly.
8 years ago
Siegfried Pammer
c1fca21e8a
Make ILRange field private - introduce public API for IL range manipulation.
8 years ago
Siegfried Pammer
b9f179465d
Fix part 1 of #1292 : switch on string inside try-block not recognized.
8 years ago
Chicken-Bones
e9b766d708
Improve persistence of IL offsets through various transforms.
8 years ago
Siegfried Pammer
65cf13ce27
Fix #1270 : Bad decompilation of mcs switch-on-string
8 years ago
Chicken-Bones
62b2ad4f8d
Improve UseCSharpSwitch to reduce over-aggressive use of switch producing poor quality code.
8 years ago
Siegfried Pammer
20ccd51948
Fix bug in SwitchOnStringTransform.SimplifyCascadingIfStatements: Do not eliminate unrelated stores right before the start of the switch.
8 years ago
Siegfried Pammer
dfa99a8c1f
Fix build.
8 years ago
Siegfried Pammer
abbf3d0429
Fix #1158 : C# 1 switch pattern improvement
8 years ago
Siegfried Pammer
9443983819
Fix #1144 : MatchRoslynCaseBlockHead did not handle inverse conditions properly.
8 years ago
Siegfried Pammer
644941d25b
Fix C# 1.0 switch on string transform and add tests
8 years ago
Siegfried Pammer
3eb694baee
Fix #1107 : bug in mcs switch on string detection.
9 years ago
Siegfried Pammer
b400d89f57
Fix #1076 ; improve detection of mcs switch-on-string pattern
9 years ago
Siegfried Pammer
7544eac5b4
Add support for mcs 2.6.4 switch-on-string
9 years ago
Siegfried Pammer
33c5e2d3ed
Add StackType.F4 and StackType.F8, and instructions LdcF4 and LdcF8.
9 years ago
Daniel Grunwald
2824906f8f
Code cleanup SwitchOnStringTransform.
9 years ago
Siegfried Pammer
1ac631b3f1
SwitchOnStringTransform: fix bugs in ExtractStringValuesFromInitBlock and MatchAddCall
9 years ago