Daniel Grunwald
a0b144d332
Use `Unsafe.AsPointer()` for `ConversionKind.StopGCTracking`.
5 years ago
Daniel Grunwald
35c405b973
Translate the initializer of a `fixed` statement as managed reference and only apply the ref-to-pointer conversion at the end.
...
This way we create compilable code when the pinned variable type does not match the initializer type.
5 years ago
Daniel Grunwald
a9d643b208
Emit a call to `ref Unsafe.As<TFrom, TTo>(ref TFrom)` when the IL code contains a mismatch of managed reference types.
...
The previously emitted `ref *(TTo*)(&source)` only compiles when `source` is a local variable; otherwise C# complains about the memory not being pinned.
Note that we special-case local variables to keep the previous behavior around; this avoids pulling in `System.Runtime.CompilerServices.Unsafe.dll` when it's unnecessary.
5 years ago
Daniel Grunwald
2c0554f129
Fix #1963 : Support decompiling `calli` instructions into C# 9 function pointer syntax.
5 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.
5 years ago
Daniel Grunwald
ad5ba9295e
Fix #1924 : preserve hexadecimal format when converting literal to wider type
5 years ago
Daniel Grunwald
7326a69823
Fix #1795 : `InvalidCastException: Cast from Boolean to Int64 not supported` when decompiling enum with bool constants
6 years ago
Daniel Grunwald
5847d87651
Adjust tests: test runner now adds+removes TargetFramework attribute
6 years ago
Daniel Grunwald
0465cc8475
Adjust expected output in ILPretty tests
6 years ago
Siegfried Pammer
d2f7258347
Fix #1681 : Use discard assignment, if possible.
6 years ago
Daniel Grunwald
8117dfff4a
Fix #1242 : Discard unreachable code.
...
Unreachable code is not part of the dominator tree, which most of our transforms are based on.
In particular, dominance-based loop detection runs into the problem where unreachable code might have jumps into two independent loops. In that case, it's impossible to place the unreachable code in a way that avoids assertions / generating invalid C#.
We establish the invariant that all blocks in a BlockContainer must be statically reachable from the entry point (-> every block is part of the dominator tree). This means transforms no longer have to deal with special cases for unreachable code.
The "Remove dead and side effect free code" option still has an effect on dead stores, but unreachable code is now always removed (previously this also was dependent on this option).
6 years ago
Daniel Grunwald
42eafb587f
Fix #684 : Improve detection of variable type for stack slots.
6 years ago
Daniel Grunwald
7e3b36aaa7
#1563 : Where possible, replace an explicit interface implementation call with a call to the interface member.
6 years ago
Daniel Grunwald
961923f4fd
#1499 , #1240 : Translate pointer arithmetic on managed pointers (ref T) using the System.Runtime.CompilerServices.Unsafe intrinsics
6 years ago
Siegfried Pammer
3abb548e1e
Fix #1479 : Unable to cast object of type 'System.Int32' to type 'System.Single'
6 years ago
Siegfried Pammer
61b170463e
Add missing files.
6 years ago
Daniel Grunwald
ae2824af99
Fix #617 : Incorrect C# translation when `callvirt` is used to invoke base constructor
6 years ago
Daniel Grunwald
67124b3b9d
Adjust tests to sorted top-level-types.
6 years ago
Siegfried Pammer
5962d4675f
Add IL tests for basic isinst patterns. Undo change mentioned in 54ff546221 (commitcomment-32359757)
6 years ago
Siegfried Pammer
8dffec24b9
Add SequenceOfNestedIfs test.
6 years ago
Siegfried Pammer
667e04462a
Fix #1325 : Do not perform inline assignment transform on setter calls, that belong to parameterized properties.
7 years ago
Siegfried Pammer
64e1bb6f4d
Add missing files.
7 years ago
Daniel Grunwald
4e9121bd28
Add test case for #1304 .
7 years ago
Eugene
57cea66ee1
Fix new line
7 years ago
Eugene
a80672ba42
Change rules for VisitUnboxAny & fix issue https://github.com/icsharpcode/ILSpy/issues/1256
7 years ago
Siegfried Pammer
e6fa143ef1
Fix #888 : [3.0 Preview 1] F# code decompiles to ... unoptimal C#
7 years ago
Daniel Grunwald
d166101387
Allow splitting variables that have their address taken.
...
This works if all addresses are immediately used in calls (as common with method calls on value-type,
which take 'this' by-reference); as long as the call doesn't return the reference again.
Closes #1136 .
7 years ago
Daniel Grunwald
078b638149
Adjust Issue982.cs to [IndexerName]
7 years ago
Siegfried Pammer
8f47e8429b
Fix #1157 : Decompilation of abstract events and overridden auto events
7 years ago
Siegfried Pammer
497de76a2f
Update test case for #1145
7 years ago
Siegfried Pammer
1646be7482
#1145 : Make type arguments optional in mcs auto event pattern.
7 years ago
Siegfried Pammer
644941d25b
Fix C# 1.0 switch on string transform and add tests
7 years ago
Siegfried Pammer
5dd7eaf129
Fix #1093 : Remove usage of type or this qualifiers, when possible.
7 years ago
Siegfried Pammer
659b12bdb8
Fix #1083 : add pattern for mcs auto events (version 4)
7 years ago
Siegfried Pammer
cecf153a0c
#1047 : Update test case provided by @tamlin-mike
7 years ago
Siegfried Pammer
ebf213d85e
Fix #1047 : Unsupported method
7 years ago
Siegfried Pammer
9b160c13e7
Fix #982 : ILSpy should ignore the parameter name of property setter and always use "value" instead in C#
8 years ago
Siegfried Pammer
2c68d99336
Fix #959 : Crash in CSharp.StatementBuilder.TranslateSwitch (due to empty sequence)
8 years ago
Siegfried Pammer
4b1488685f
Add test cases for #888
8 years ago
Siegfried Pammer
97eac21021
Update F# using pretty tests
8 years ago
Daniel Grunwald
8c5de98a39
Move UnsafeCode tests to pretty-tests (except for those that are not yet successful).
8 years ago
mohe2015
71349ba11e
Implement pretty test. - Does not work with roslyn
8 years ago
mohe2015
509b69f685
Add test case.
8 years ago
Siegfried Pammer
aa0e379236
Add tests to ILPrettyTestRunner
8 years ago
Siegfried Pammer
7c5ded93f0
Move F# Tests to ILPrettyTestRunner
8 years ago
Siegfried Pammer
23bca3713f
Fix #646 : VB-compilers 'For Each In' is not recognized as foreach during decompilation
8 years ago
Daniel Grunwald
c2ac9c374c
Use tabs instead of spaces.
8 years ago
Siegfried Pammer
bc4b078de9
Add missing files.
8 years ago