danbopes
01b968fbbd
Add opt-in SortSwitchSections setting ( #3749 ). ( #3750 )
...
When enabled, switch sections are ordered by their case label value
instead of by the underlying branch's IL offset. Default is false to
keep existing output unchanged. Useful when diffing decompiler output
across rebuilds of obfuscated assemblies, where IL block layout is
unstable but the case-to-value mapping is not.
Includes an ILPretty test that exercises a hand-written switch whose
table targets are placed at non-monotonic IL offsets (simulating
obfuscator block shuffling) and verifies the cases come out in
label-value order with the setting enabled. Also adds the
Resources.resx / Resources.Designer.cs entry so the WPF settings UI
shows a proper label instead of the raw key.
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
4 weeks ago
Siegfried Pammer
f6c763e7bb
Add tests for ExtensionEncodingV1 and ExtensionEncodingV2.
8 months ago
Jeremy Pritts
d1dc7b258a
Copy-propagate the stack slot for collection initializers ( #3554 )
...
* Copy-propagate the stack slot for collection initializers
* Use pattern matching
10 months ago
Peter Crabtree
e1e16b64f5
dev: Strip BOM mark from text files
10 months ago
Daniel Grunwald
89083eaf48
Fix #3344 : Add support for the `ckfinite` opcode.
11 months ago
Siegfried Pammer
052466fce7
Add test case
11 months ago
Siegfried Pammer
ddb7171a2a
Fix #3524 : Property without backing field cannot have an initializer.
11 months ago
Siegfried Pammer
cc4588db4b
Add a test case
1 year ago
Jeremy Pritts
0261ca3ae8
Fix stack overflow exception in CSharpResolver ( #3471 )
...
* Fix stack overflow exception in CSharpResolver
* lhs and rhs
1 year ago
ds5678
7f024de786
Don't include generic constraints in generated explicit overrides
1 year ago
ds5678
a1b3b14b0b
Add test
1 year ago
Christoph Wille
fba0dbae8d
Migrate to NUnit 4 ( #3132 )
...
* Migrate to NUnit 4 based on https://docs.nunit.org/articles/nunit/release-notes/Nunit4.0-MigrationGuide.html . Needed fix for https://github.com/nunit/nunit/issues/4564
* Test 4.1.0-adev.1 from NUnit MyGet feed (works locally in VS)
* Update to bugfix version adev.2 (works on GH)
* NUnit 4.0.1 final
3 years ago
ElektroKill
4601481dec
Add ILPretty test for MCS 2.6.4 fixed string
3 years ago
Daniel Grunwald
94d2ce0fcf
Fix crash when control flow reaches end of method.
3 years ago
Siegfried Pammer
6139d9d58e
Delete created temp files if test execution was successful.
4 years ago
James May
4a1f79a32a
Assume conventionally named unresolved method references are properties or events.
...
eg. decompiles to .Property instead of .get_Property()
4 years ago
Siegfried Pammer
e4b63f7a35
- Make all tests async.
...
- Use custom test runner for correctness tests.
- Use .NET 6.0 framework for all Roslyn compiler tests.
- Disabled tests involving new string interpolation patterns.
4 years ago
Siegfried Pammer
d8bb40b45b
Generate file-scoped namespace declarations, if possible.
5 years ago
Siegfried Pammer
ec1b9a4ccd
Fix #2443 : do not use this()-ctor initializers by accident if base type is unknown.
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
Daniel Grunwald
80cf72e498
#2182 : Move "Transform call to struct constructor" from EarlyExpressionTransforms to ILReader.
...
This fixes the evaluation order for such calls (and an assertion in StObj.CheckTargetSlot).
6 years ago
Daniel Grunwald
47685c4b57
Fix weird casts to `nint` when writing to fields of unknown type.
6 years ago
Daniel Grunwald
836bc37050
Upgrade ilasm.exe version. This allows us to write tests for the new function pointer calling conventions.
6 years ago
dotnet format
0d9f871a4f
#2128 : Reformat the whole code base.
6 years ago
Siegfried Pammer
9e0e8d1cbc
Add basic support for C# 8.0 enhanced using statements.
6 years ago
Siegfried Pammer
15028b3669
Fix #2104 : Check field name of backing field when attempting to transform to an auto property.
6 years ago
Daniel Grunwald
abb9d49a0f
Add support for C# 8 switch expressions.
6 years ago
Daniel Grunwald
2c0554f129
Fix #1963 : Support decompiling `calli` instructions into C# 9 function pointer syntax.
6 years ago
Daniel Grunwald
65fe59e393
#1918 : Fix a bunch of issues with pinned region detection.
...
Not every pinned region has a clean `P = null` assignment to mark its end.
If a second pinned region starts with the same variable `P`, consider that to mark the end of the previous pinned region for that variable.
Also, fix a bunch of special cases with empty pinned regions.
6 years ago
Daniel Grunwald
ad5ba9295e
Fix #1924 : preserve hexadecimal format when converting literal to wider type
6 years ago
Daniel Grunwald
7326a69823
Fix #1795 : `InvalidCastException: Cast from Boolean to Int64 not supported` when decompiling enum with bool constants
7 years ago
Siegfried Pammer
d2f7258347
Fix #1681 : Use discard assignment, if possible.
7 years ago
Siegfried Pammer
047f119e99
Add RemoveDeadStores option
7 years ago
Daniel Grunwald
42eafb587f
Fix #684 : Improve detection of variable type for stack slots.
7 years ago
Daniel Grunwald
7e3b36aaa7
#1563 : Where possible, replace an explicit interface implementation call with a call to the interface member.
7 years ago
Daniel Grunwald
961923f4fd
#1499 , #1240 : Translate pointer arithmetic on managed pointers (ref T) using the System.Runtime.CompilerServices.Unsafe intrinsics
7 years ago
Siegfried Pammer
3abb548e1e
Fix #1479 : Unable to cast object of type 'System.Int32' to type 'System.Single'
7 years ago
Siegfried Pammer
b0cb976357
Fix #1454 : Name collision after converting for-over-array to foreach.
7 years ago
Siegfried Pammer
5962d4675f
Add IL tests for basic isinst patterns. Undo change mentioned in 54ff546221 (commitcomment-32359757)
7 years ago
Siegfried Pammer
8dffec24b9
Add SequenceOfNestedIfs test.
7 years ago
Siegfried Pammer
667e04462a
Fix #1325 : Do not perform inline assignment transform on setter calls, that belong to parameterized properties.
8 years ago
Siegfried Pammer
6c193ac50e
Fix #1323 : NRE in DetectBestEnumValueDisplayMode; emit error message, if enum field definition has no constant value.
8 years ago
Eugene
a80672ba42
Change rules for VisitUnboxAny & fix issue https://github.com/icsharpcode/ILSpy/issues/1256
8 years ago
Siegfried Pammer
e6fa143ef1
Fix #888 : [3.0 Preview 1] F# code decompiles to ... unoptimal C#
8 years ago
Siegfried Pammer
8cbf724901
Move CustomAttributeTests to PrettyTestRunner
8 years ago
Siegfried Pammer
8f47e8429b
Fix #1157 : Decompilation of abstract events and overridden auto events
8 years ago
Siegfried Pammer
1646be7482
#1145 : Make type arguments optional in mcs auto event pattern.
8 years ago
Siegfried Pammer
644941d25b
Fix C# 1.0 switch on string transform and add tests
8 years ago
Daniel Grunwald
d9a28314f9
Upgrade to NUnit 3.9 and enable parallel test execution.
8 years ago
Siegfried Pammer
659b12bdb8
Fix #1083 : add pattern for mcs auto events (version 4)
9 years ago