Commit Graph
1344 Commits
Author SHA1 Message Date
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
Siegfried Pammer 584d1847df Fix #2405: Assertion fail in TDCU 2021-05-29 22:31:31 +02:00
Siegfried Pammer 2d65deffda Fix frontends.sln build. 2021-05-27 00:53:25 +02:00
Siegfried Pammer ba39dd5c55 Fix #2354: decompilation of unary and binary operators with nullable value types. 2021-05-26 23:42:51 +02:00
Daniel Grunwald 407ec6be5b Adjust AsyncAwaitDecompiler to Roslyn 3.9.0. 2021-05-26 19:41:51 +02:00
Siegfried Pammer d92dd153fc #2390: Make sure all unused captured variables are removed even in lambdas. 2021-05-08 14:36:04 +02:00
Siegfried Pammer e20ace0098 Fix build. 2021-05-08 14:34:50 +02:00
Siegfried Pammer d54016ce8f #2390: Add support for generic object initializers. 2021-05-08 13:51:50 +02:00
Daniel Grunwald bd9aabeae2 Update to dotnet-format 5.1.225507.
This makes the formatting expected by our CI consistent with that generated by VS2019.9.
2021-05-07 22:23:09 +02:00
Siegfried Pammer 7211587b45 Fix #2366: NRE in AwaitInCatchTransform.MatchAwaitCatchHandler() and pattern errors when dealing with a switch-based jump table in AwaitInCatchTransform 2021-04-12 18:42:10 +02:00
Siegfried Pammer 76227af89d Fix #1749, fix #2339, fix #2353: Add support for rethrow in async exception handlers, fix await catch/finally patterns for complex methods. 2021-04-07 13:12:49 +02:00
Siegfried Pammer d2fc380e0e Fix #2349: Use proper ExpressionType with DynamicCompoundAssign. 2021-03-22 19:19:50 +01:00
Siegfried Pammer d60f158dfd Fix #2342: Do not generate empty names for foreach loop variables. 2021-03-20 10:53:29 +01:00
Siegfried Pammer 4ae41a855e Fix #2321: Missing readonly modifier for ref local 2021-03-12 10:08:09 +01:00
Daniel Grunwald eec24ee6bb Fix #2311: Handle additional comp instruction in IsNullSafeArrayToPointerNotNullBlock 2021-02-23 21:55:27 +01:00
Daniel Grunwald f726a0b73e #nullable enable for typesystem and ILInstruction base class 2021-02-16 21:59:13 +01:00
Siegfried Pammer 67be41a998 #2294: Fix potential NRE: finalStore is accessed before null check. 2021-02-16 20:15:58 +01:00
文煌 581a1de185 fix https://github.com/icsharpcode/ILSpy/issues/2288 2021-01-31 02:42:55 +08:00
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;
        ...
```
2021-01-23 16:55:51 +01:00
Siegfried Pammer 669fe6417e Fix #2280: Add additional checks to GenerateVariableName 2021-01-22 14:05:14 +01:00
Siegfried Pammer 66850e4725 Fix #2270: I love deleting code that causes problems and no longer makes any sense at all! 2021-01-10 23:13:08 +01:00
Siegfried Pammer 288c6a75e7 Use ToLower instead of ToLowerInvariant. 2021-01-07 17:51:36 +01:00
Siegfried Pammer dd84f17ea1 #2263: Fix IsLowerCase to take script without upper/lower case distinction into account. 2021-01-07 17:48:59 +01:00
Siegfried Pammer 06bae54b91 Fix #2263: Add lower-case type and member names to the list of existing names, to prevent collisions. 2021-01-06 21:22:36 +01:00
Siegfried Pammer 3676107379 Fix #2266: Failed to decompile complex expression tree. 2021-01-06 19:06:46 +01:00
Siegfried Pammer 3df82cf33b Add support for 'with' expressions 2021-01-03 20:55:25 +01:00
Siegfried Pammer 9932b5d9f2 Fix #2230: do not emit directly consecutive null propagation operators. 2020-12-28 19:55:06 +01:00
Siegfried Pammer c986dbe889 Fixes #2232: We only need a small percentage of features provided by Humanizer. Therefore we copy the relevant parts and remove the dependency in order to avoid such problems in the future. 2020-11-29 16:42:16 +01:00
Siegfried Pammer d0d8299ef5 Use Name from DynamicInvokeMemberInstruction when inferring variable names. 2020-11-15 12:24:02 +01:00
Daniel Grunwald 6e8c1b3117 ILReader: support comparison between StackType.Ref and StackType.I
Update Unsafe.il tests to .NET 5.0 version.
2020-11-12 22:16:56 +01:00
Daniel Grunwald 782e4ae88c Fix #2215: Use Unsafe intrinsics for ldobj/stobj instructions.
Use `Unsafe.As` to adjust the type of a managed reference if necessary (without converting to a pointer type).
This also adds support for the `ReadUnaligned`/`WriteUnaligned` intrinsics.
2020-11-12 18:44:12 +01:00
Siegfried Pammer b7d2eec41d #2199: Add support for VB cached delegate initialization 2020-10-25 19:47:18 +01:00
Siegfried Pammer d3b0e4cd72 Fix #2196: Add support for extern local functions. 2020-10-24 23:12:55 +02:00
Siegfried Pammer a7f58e8657 Fix build and use specific version of dotnet-format. 2020-10-24 10:57:14 +02:00
Siegfried Pammer 3a7c69e5b9 Fix #2192: Add support for VB.NET delegate construction 2020-10-23 21:38:38 +02:00
Siegfried Pammer be57dc454c Run tests with different versions of Roslyn 2020-10-23 19:29:19 +02:00
Daniel Grunwald 2683079db6 Merge remote-tracking branch 'origin/release/6.2' into master 2020-10-12 17:01:53 +02:00
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).
2020-10-07 23:59:22 +02:00
Siegfried Pammer 2530c9a2ce #2182: Do not inline switch value, in case variable is reused. 2020-10-07 22:38:34 +02:00
Daniel Grunwald 47685c4b57 Fix weird casts to nint when writing to fields of unknown type. 2020-10-07 20:47:26 +02:00
Siegfried Pammer 2612a06a11 Fix #2174: Some compilers produce display class ctors with unused local variables
(cherry picked from commit 71b54e87a0)
2020-10-07 18:40:19 +02:00
Siegfried Pammer 71b54e87a0 Fix #2174: Some compilers produce display class ctors with unused local variables 2020-10-04 21:15:13 +02:00
Daniel Grunwald 8573c5282e Avoid code duplication when disassembling signature headers. 2020-09-17 19:04:42 +02:00
Daniel Grunwald 9381be2280 #2158: Fix decompilation of arithmetic on managed pointers after ConversionKind.StartGCTracking. 2020-09-12 17:23:28 +02:00
Daniel Grunwald e8b35a481a Fix #2156: range syntax not being detected correctly in some cases 2020-09-11 21:36:41 +02:00
Siegfried Pammer 41edef710e Fix build. 2020-09-08 22:15:27 +02:00
Siegfried Pammer 0b0a6d94a8 Add support for local function pointers. 2020-09-08 21:27:57 +02:00
Daniel Grunwald 9d590e4c1e Merge pull request #2150 from icsharpcode/fnptr
Support for C# 9 function pointers
2020-09-08 10:48:51 +02:00
Daniel Grunwald 0e1c24464f Fix #2148: Don't attempt to detect fixed statement for pinned value types 2020-09-06 22:24:36 +02:00