Christoph Wille
ca0adee72f
Using EnumExtensions source generators & interception (ics.d-only)
4 months ago
Siegfried Pammer
c0a9afc4ad
Fix #3616 : local variable naming conflict with primary constructor parameters.
4 months ago
Siegfried Pammer
588c243929
#3593 : ObjectInitializers: allow castclass instructions wrapping the init instruction to support the pattern used for covariant returns on non-supporting platforms such as .NET 4.x.
5 months ago
Siegfried Pammer
126e870a5a
Fix #3577 : Properly infer the switch governing type and preserve conversions
6 months ago
ds5678
dc3ed43dd8
Do not create object initializers for tuples
6 months ago
ds5678
df9cc3dfbe
Null forgiveness for UsingScope
6 months ago
ds5678
c54318173b
Fix lower case type name conflicting with variable name
6 months ago
Siegfried Pammer
0e1478ffce
Fix #3564 : extend TransformDisplayClassUsage.IsPotentialClosure to support sibling DisplayClasses calling each other.
7 months ago
ds5678
1d964bce8e
Fix regression in decompiling local functions with default parameters
7 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
7 months ago
Peter Crabtree
e1e16b64f5
dev: Strip BOM mark from text files
7 months ago
Daniel Grunwald
587a359e8c
Fix #1873 : Clear ILRange in CopyPropagation
...
We are copying an expression from far away, reusing the ILRange would result in incorrect sequence points.
8 months ago
Daniel Grunwald
c84605a610
Fix #3468 : Try harder to avoid ref locals if `UseRefLocalsForAccurateOrderOfEvaluation` is not enabled.
...
CopyPropagation will replace `ref StructWithStringField reference = ref array[0];` with:
```
var x = array;
var y = 0;
```
and then every use of `reference` is replaced with `x[y]`.
This lets us avoid rough locals while preserving the semantics in every case except that we re-order when a NullReferenceException/IndexOutOfRangeException occurs.
8 months ago
Daniel Grunwald
dd4bf7d8a4
Fix #3518 by replacing `FixLoneIsInst` with an inlining restriction.
...
This way we avoid having to extract later, as we will never inline if the `isinst` argument if this could result in it being unrepresentable in C#.
This commit also refactors inlining restrictions to avoid requiring special cases in ILInlining itself.
But when making this change, I discovered that this broke our pattern-matching tests, and that the weird IL with double `isinst` is indeed generated by the C# compiler for `if (genericParam is StringComparison.Ordinal)` style code. So instead we also allow `isinst` with a `box(expr-without-side-effects)` argument to be represented with the `expr is T ? (T)expr : null` emulation.
8 months ago
ds5678
15223daabd
WIP preincrement improvements
8 months ago
Siegfried Pammer
9dde97414a
Rename ResolvedUsingScope to UsingScope
8 months ago
Siegfried Pammer
c9e3790adc
Remove UnresolvedUsingScope
8 months ago
Siegfried Pammer
d2d9281072
Move CanTransformToExtensionMethodCall to CSharpResolver
8 months ago
Siegfried Pammer
f97e59760b
Fix #3512 : Local function name collides with local variable name
8 months ago
Siegfried Pammer
49368caf1c
Rename option to "UseObjectCreationOfGenericTypeParameter"
9 months ago
Siegfried Pammer
51a26180bb
Fix #3492 : Do not crash, if field used by RuntimeHelpers.InitializeArray is malformed.
9 months ago
Siegfried Pammer
fecb10f109
Generalize ILInlining special cases for in arguments of ROS<T> ctors.
9 months ago
Siegfried Pammer
2461f520ab
Move LocalFunctionDecompiler.GetStatement to Block.GetContainingStatement
9 months ago
Siegfried Pammer
298c247355
InlineArrayTransform: Add more bounds checking
10 months ago
Siegfried Pammer
47dd905ad0
Make InlineArrayTransform post-order
10 months ago
Siegfried Pammer
79f7a188b0
Add support for C# 12 inline array expressions
10 months ago
Siegfried Pammer
cb790c6d38
Allow variable splitting of compiler-generated temporaries for Span<T>/ROS<T>
10 months ago
Daniel Grunwald
7fc9025500
Fix nullability of Extract return type
11 months ago
Siegfried Pammer
b1a617c827
AssignVariableNames: Fix ArgumentException
12 months ago
Siegfried Pammer
6c72d1c5f0
Add transform to remove unconstrained generic reference type check.
1 year ago
Siegfried Pammer
9f77f8a919
Prevent inlining of call arguments when doing so would change order of evaluation with regards to the implicit ldobj performed by a constrained.callvirt.
1 year ago
Siegfried Pammer
485ca1d69a
Fix #3353 : Normal method is decompiled as lambda expression.
1 year ago
Siegfried Pammer
7d0262d779
Fix #3439 : Regressed decompilation of variables in lambda scope
1 year ago
Siegfried Pammer
349a89c1fa
Fix #3436 : Duplicate naming of local functions
1 year ago
Siegfried Pammer
355a039b59
Sightly improve variable naming of known types such as EventArgs and Exceptions
1 year ago
Siegfried Pammer
8a67f48e4e
Fix #1956 : Adapt previous fix for variable names that have a number as suffix.
1 year ago
Siegfried Pammer
ffcd468d22
Fix #1572 : parameters of lambdas and local functions are renamed, if there are with names from outer scopes collisions.
1 year ago
Siegfried Pammer
03aecf047d
Add VariableScope and rework AssignVariableNames step to support renaming parameters of nested ILFunctions in the future.
1 year ago
Siegfried Pammer
a599aae54d
#1572 : Do not generate variable names that match C# keywords.
1 year ago
Siegfried Pammer
73e9771d3c
Fix #2269 : LocalFunctionDecompiler misplaces nested local functions in ctors
1 year ago
Siegfried Pammer
49942382d1
Fix #3432 : Do not include delegate construction use-sites in DetermineCaptureAndDeclarationScopes.
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`.
1 year ago
ds5678
cbe8dd43d7
Fix null check in MatchLegacySwitchOnStringWithDict
...
Updated the condition for `nullValueCaseBlock` to ensure it is not null and not equal to `defaultBlock`.
1 year ago
ds5678
3a13d5a698
Allow explicit null termination character
1 year ago
Siegfried Pammer
38cdf6d50a
Avoid transforming sub pattern of cpblk stackalloc initializer
1 year ago
Siegfried Pammer
bd0fd8db1f
Small refactorings:
...
- extract common code
- reduce nesting
1 year ago
ds5678
b0d6fa2276
Add support for array initialization based on RuntimeHelpers.CreateSpan<T>
1 year ago
Siegfried Pammer
5b90dbdabf
Fix #3385 : Allow address uses of structs in using transform, if the reference is passed to an in parameter.
1 year ago
Siegfried Pammer
202c5e22e3
Fix #3383 : more aggressively transform object initializers on structs
1 year ago
Siegfried Pammer
906d248403
Fix #3392 : uses of init-setters must use object-initializer syntax.
1 year ago