Siegfried Pammer
6c72d1c5f0
Add transform to remove unconstrained generic reference type check.
4 months 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.
4 months ago
Siegfried Pammer
03aecf047d
Add VariableScope and rework AssignVariableNames step to support renaming parameters of nested ILFunctions in the future.
4 months ago
Siegfried Pammer
5d36732fcf
Remove ApplyPdbLocalTypeInfoTypeVisitor (merge it into ApplyAttributeTypeVisitor)
1 year ago
Siegfried Pammer
4bf9487ecd
Remove IsRef, IsOut and IsIn flags from IParameter and Replace ParameterModifiers with ReferenceKind.
1 year ago
Daniel Grunwald
fa19470435
Fix #3218 : Avoid exceptions when IL is invalid due to unexpected end-of-method-body.
1 year ago
Siegfried Pammer
ca78d4a14d
Use MetadataFile instead of PEFile in TypeSystem.
1 year ago
ElektroKill
38019ad5bf
Introduce `PdbExtraTypeInfo` struct and adjusted `IDebugInfoProvider`
2 years ago
ElektroKill
5b526cfeac
Read and use tuple element names and dynamic type information from PDBs
2 years ago
Daniel Grunwald
d2d1c3326f
Fix #3070 stack order on block reimport
2 years ago
Daniel Grunwald
5206aef4ce
Fix #3071 BlockBuilder assertion for unreachable try-block
2 years ago
Siegfried Pammer
0fc003459f
Fix #3079 : Replace parameter names that consist of only whitespace
2 years ago
Daniel Grunwald
9becae2de7
Fix #3051 : "InvalidOperationException: Stack empty" when decompiling reference assembly with empty method bodies
2 years ago
Daniel Grunwald
768cb02f0b
Fix #2964 : Better error message when a method only contains a single ret instruction.
2 years ago
Daniel Grunwald
94d2ce0fcf
Fix crash when control flow reaches end of method.
2 years ago
Daniel Grunwald
b9ce8490f5
Remove hack that prevented inlining of the first instruction in each block.
...
Now that ILReader already creates the basic blocks and BlockBuilder only arranges them in containers, this code is no longer necessary.
2 years ago
Daniel Grunwald
b93e65cdad
Fix #901 : Refactor ILReader: only read reachable code + support reimports
...
This makes our logic more similar to that used by the dotnet runtime. This lets us infer correct stack types in edge cases such as #2401 . It also improves support for obfuscated control flow such as #2878 .
2 years ago
Daniel Grunwald
72a895f64f
#nullable enable for ILReader
2 years ago
Siegfried Pammer
9f6f7a03ac
Fix #2788 : Handling of cpobj in ILReader was missing the stobj special case for the target pointer.
3 years ago
Siegfried Pammer
81f575e9ce
Use PopStObjTarget in ILReader, if a call instruction has the same semantics as initobj.
3 years ago
Daniel Grunwald
9254abcf88
Fix StObj.CheckTargetSlot assertion
3 years ago
Daniel Grunwald
c36c6efb2a
ILReader: don't create stack slots if we can directly created inlined ILAst
...
This is a performance optimization: we dramatically reduce the amount of ILVariables created;
and thus need to spend less time in the first ILInlining run.
3 years ago
Siegfried Pammer
af56bb10d0
Determine isBranchTarget in a separate pass. We will need it for an optimization to ILReader in a future commit.
3 years ago
Daniel Grunwald
f104233e78
Fix #2388 : Add support for branch from catch-block to try-block (VB `On Error Resume Next`)
4 years ago
Siegfried Pammer
e1ca4db851
Fix #2527 : Support skip locals init
4 years ago
Siegfried Pammer
1568aeca3e
Fix #2506 : NamedArgumentTransform loses information, if the original variable is of StackType.Ref
4 years ago
Daniel Grunwald
6e8c1b3117
ILReader: support comparison between StackType.Ref and StackType.I
...
Update Unsafe.il tests to .NET 5.0 version.
5 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).
5 years ago
Daniel Grunwald
47685c4b57
Fix weird casts to `nint` when writing to fields of unknown type.
5 years ago
Daniel Grunwald
3831b42197
Properly support `calli` instruction and its interaction with function pointer types.
5 years ago
dotnet format
0d9f871a4f
#2128 : Reformat the whole code base.
5 years ago
Daniel Grunwald
bdea1950a8
Add `#if !NETCORE` around extension methods that are included with .NET Core 3
5 years ago
Daniel Grunwald
2c0554f129
Fix #1963 : Support decompiling `calli` instructions into C# 9 function pointer syntax.
5 years ago
Jackson Davis
6ab1f98fa3
Expand the range of sequence points out the closest empty ilstack
...
or implicit sequence point without creating overlapping sequence points.
If such a location cannot be found do, nothing. Fill in the
gaps with hidden sequence points.
Also emit a sequence point for
the prolog to account for seqeunce point there emitted by the C#
compiler. Without this, the debugger can stop there on a step in
using the original pdb, then decompile resulting in a no-code at this
location failure.
5 years ago
SilverFox
f039705704
Add support for generic local function
6 years ago
Daniel Grunwald
a1c211f326
Fix #1794 : Avoid extra cast to double for ulong -> float conversion
6 years ago
Daniel Grunwald
ae32913aca
Add IMethod.ThisIsRefReadOnly
6 years ago
Siegfried Pammer
9190515d8b
#1151 : Support for ref readonly locals.
6 years ago
Daniel Grunwald
57b725df79
Fix #1655 : Incorrect pointer cast when calling method on integer constant
6 years ago
Siegfried Pammer
6b075326f0
Fix #1615 : Handle nil tokens gracefully.
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
c366235246
#1349 : Fix type substitution for members of unknown generic types (due to unresolved references)
...
Also, assume that unknown inputs to ldfld are temporaries, not unmanaged pointers.
This avoids emitting weird pointer casts when accessing fields on unresolved value types.
6 years ago
Siegfried Pammer
d50b8d66d1
Fix #1373 , fix #1541 : add support for instance calls to CallIndirect.
6 years ago
Siegfried Pammer
bd77b8301f
Basic implementation of local functions.
6 years ago
Siegfried Pammer
c1fca21e8a
Make ILRange field private - introduce public API for IL range manipulation.
7 years ago
Daniel Grunwald
47ca51a769
Clarify the meaning of ILVariable.Index
7 years ago
Daniel Grunwald
70138fa63d
#1336 : Use delayed exceptions for Array.Get/Set.
...
We use this flag for the ldelem/stelem representation, so we need to also use
it for Get/Set on multi-dimensional arrays.
7 years ago
Daniel Grunwald
2f54eee5db
#1195 : Fix comparison of object reference with ldc.i4 0.
7 years ago
Daniel Grunwald
ba0a3af3c4
#1195 : Fix several issues decompiling SharpSvn.dll (C++/CLI)
7 years ago
Daniel Grunwald
0006330c1a
Fix #1235 : Insert StackType conversion when filling in Leave target.
7 years ago