Siegfried Pammer
485ca1d69a
Fix #3353 : Normal method is decompiled as lambda expression.
2025-03-31 23:36:49 +02:00
Siegfried Pammer
7d0262d779
Fix #3439 : Regressed decompilation of variables in lambda scope
2025-03-29 20:23:49 +01:00
Siegfried Pammer
349a89c1fa
Fix #3436 : Duplicate naming of local functions
2025-03-29 17:57:43 +01:00
Siegfried Pammer
355a039b59
Sightly improve variable naming of known types such as EventArgs and Exceptions
2025-03-21 08:34:44 +01:00
Siegfried Pammer
8a67f48e4e
Fix #1956 : Adapt previous fix for variable names that have a number as suffix.
2025-03-21 08:34:44 +01:00
Siegfried Pammer
ffcd468d22
Fix #1572 : parameters of lambdas and local functions are renamed, if there are with names from outer scopes collisions.
2025-03-21 08:34:44 +01:00
Siegfried Pammer
03aecf047d
Add VariableScope and rework AssignVariableNames step to support renaming parameters of nested ILFunctions in the future.
2025-03-21 08:34:44 +01:00
Siegfried Pammer
a599aae54d
#1572 : Do not generate variable names that match C# keywords.
2025-03-21 08:34:44 +01:00
Siegfried Pammer
73e9771d3c
Fix #2269 : LocalFunctionDecompiler misplaces nested local functions in ctors
2025-03-21 00:10:00 +01:00
Siegfried Pammer
49942382d1
Fix #3432 : Do not include delegate construction use-sites in DetermineCaptureAndDeclarationScopes.
2025-03-19 22:52:27 +01:00
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`.
2025-03-15 01:29:58 -07:00
ds5678
cbe8dd43d7
Fix null check in MatchLegacySwitchOnStringWithDict
...
Updated the condition for `nullValueCaseBlock` to ensure it is not null and not equal to `defaultBlock`.
2025-03-09 21:00:36 -07:00
ds5678
3a13d5a698
Allow explicit null termination character
2025-02-22 11:35:12 +01:00
Siegfried Pammer
38cdf6d50a
Avoid transforming sub pattern of cpblk stackalloc initializer
2025-02-22 11:12:49 +01:00
Siegfried Pammer
bd0fd8db1f
Small refactorings:
...
- extract common code
- reduce nesting
2025-02-22 11:12:49 +01:00
ds5678
b0d6fa2276
Add support for array initialization based on RuntimeHelpers.CreateSpan<T>
2025-02-22 11:12:49 +01:00
Siegfried Pammer
5b90dbdabf
Fix #3385 : Allow address uses of structs in using transform, if the reference is passed to an in parameter.
2025-02-20 10:49:50 +01:00
Siegfried Pammer
202c5e22e3
Fix #3383 : more aggressively transform object initializers on structs
2025-02-20 08:51:47 +01:00
Siegfried Pammer
906d248403
Fix #3392 : uses of init-setters must use object-initializer syntax.
2025-02-12 22:58:11 +01:00
Siegfried Pammer
7218a63a46
#3367 : Extend range check to support negative integers.
2025-01-15 21:10:19 +01:00
Siegfried Pammer
b9f50901a4
Fix #3367 : Add extra validation to TransformDecimalCtorToConstant to prevent crashes with obfuscated assemblies.
2025-01-13 19:35:44 +01:00
Siegfried Pammer
e1e2f739f6
Fix switch-on-string transform for optimized Roslyn.
2025-01-05 20:21:15 +01:00
Siegfried Pammer
f66ccea9ef
Fix #3296 : Ensure unknown types are wrapped properly in "Convert Expression Tree"
2024-10-06 12:02:16 +02:00
Siegfried Pammer
966b99a7f9
Fix #3278 : Missing variable declaration in nested for-loop after many other loops
2024-09-20 22:44:32 +02:00
Siegfried Pammer
58e993d71d
Fix #3272 : Missing variable declarations in repeated nested for-loops
2024-09-14 00:06:30 +02:00
Siegfried Pammer
4864ef4462
Merge pull request #3243 from icsharpcode/improved-variable-names
...
Rewrite AssignVariableNames
2024-08-17 11:01:20 +02:00
Siegfried Pammer
2e7991eee3
TransformDisplayClassUsage: Fix #3233 by ignoring nullability annotations, when trying to find a variable to reuse/propagate.
2024-07-27 14:21:38 +02:00
Siegfried Pammer
2ca5b5affe
Rewrite AssignVariableNames algorithm to use variable usages instead of the list of variables.
2024-07-27 13:35:20 +02:00
Siegfried Pammer
c67d086e2f
Add test cases for naming conflicts related to foreach, using and fixed variables. Remove unnecessary ConflictWithLocal check in AssignVariableNames.
2024-07-21 23:22:32 +02:00
Siegfried Pammer
3fb153940b
AssignVariableNames: Handle fixed statement special cases
2024-07-21 23:20:13 +02:00
Daniel Grunwald
aa914058ce
Fix #3237 : Use ref readonly locals for readonly.ldelema
2024-07-21 12:34:58 +02:00
Siegfried Pammer
7b1f8a305c
Implemented support for string concatenation compound assignments involving ReadOnlySpan<char>.
2024-07-21 11:18:13 +02:00
Siegfried Pammer
1c71f6ad46
Support concatenation involving arguments of type ReadOnlySpan<char>.
2024-07-21 10:33:09 +02:00
Siegfried Pammer
03a20f3494
Support ILInlining for in parameters
2024-07-20 17:51:45 +02:00
Siegfried Pammer
28aa88bfb8
Make NullableLiftingTransform handle the case where ExpressionTransforms.VisitComp already lifted a nullable comparison with constant.
2024-07-20 11:58:00 +02:00
Siegfried Pammer
9d22e3ab41
NullableLiftingTransform: Undo new compiler optimization (omitting get_HasValue for comparisions with constants)
2024-07-20 10:40:31 +02:00
Siegfried Pammer
427fbcd8c0
Fix general using statement pattern
2024-07-20 09:10:31 +02:00
Siegfried Pammer
dab256ceb0
Update stackalloc initializer patterns for Roslyn 4.10.0.
2024-07-20 07:03:14 +02:00
Siegfried Pammer
a5ed5ec5cb
Support types that provide DisposeAsync without implementing IAsyncDisposable.
2024-07-19 19:34:32 +02:00
Siegfried Pammer
4bf9487ecd
Remove IsRef, IsOut and IsIn flags from IParameter and Replace ParameterModifiers with ReferenceKind.
2024-07-19 18:40:07 +02:00
Daniel Grunwald
d48df11133
Remove unused transforms: DecimalConstantTransform and ParameterNullCheckTransform
2024-07-19 09:23:17 +02:00
Siegfried Pammer
401cb77ae3
Fix #3189 : Support primitive types in Expression.Constant(object) pattern.
2024-06-06 19:24:50 +02:00
Daniel Grunwald
38e7ab4373
Fix #3110 : Add support for MCS 2.6.4 pinned region with array variable
...
* Added additional code to remove the conv instruction present in the initialization part of the pinned region.
* Extended the code responsible for removing the unpin stloc to correctly match the inverted condition found in MCS 2.6.4 compiled code.
* Enabled already present correctness test to run for MCS 2.6.4.
This is a more generalized version of the fix on PR #3110 proposed by @ElektroKill.
2024-04-01 15:06:30 +02:00
Siegfried Pammer
afbc65d14d
Merge pull request #3187 from icsharpcode/feature/roslyn492
...
Update to Roslyn 4.9.2
2024-03-30 10:12:18 +01:00
Siegfried Pammer
969e3e546a
Add support for switch on (ReadOnly)Span<char> using a compiler-generated hash function.
2024-03-29 21:20:58 +01:00
Siegfried Pammer
9ba47db69b
Add new a.GetValueOrDefault(b) -> a ?? b transform for side-effect-free default values.
2024-03-29 21:14:18 +01:00
Siegfried Pammer
ca78d4a14d
Use MetadataFile instead of PEFile in TypeSystem.
2024-03-24 15:35:13 +01:00
Siegfried Pammer
566af5c2fb
Fix #3113 : Remove GetAlternativeName and instead reuse existing names, if there are no conflicts.
2023-12-12 20:11:22 +01:00
Daniel Grunwald
d58576f409
Fix #3075 : eliminate recursion in TopologicalSort and BlockTransform.
2023-10-21 16:38:21 +02:00
Siegfried Pammer
d5cec0ab37
Fix #3103 : unaligned.stobj cannot be transformed into inline assignment
2023-10-17 22:15:45 +02:00