Siegfried Pammer
fd623ccf4f
Fix #4059 : treat a Deconstruct out argument as a definition
...
The reaching-definitions analysis does not track address loads, so a
variable that is only ever written through its address stays potentially
uninitialized for its whole life. SplitVariables merges every such load
into one live range, which is why csc lowering two deconstructions onto
the same pair of temporaries left neither of them recognizable.
IL cannot express that a method assigns through an address without
reading it first - 'out' is a C# convention over 'ref' - so the address
loads that qualify have to be named. A Deconstruct method is the one
case that matters here, and C#'s definite assignment rules rule out a
read; a Deconstruct method written in IL could read the argument, and
that possibility is knowingly ignored.
Assisted-by: Claude:claude-opus-5:Claude Code
2 weeks ago
Siegfried Pammer
77d9ee73e9
Fix IDE2000 globally
9 months ago
Peter Crabtree
e1e16b64f5
dev: Strip BOM mark from text files
1 year ago
Siegfried Pammer
6cee0cdc4b
Fix #3258 : Move GraphVizGraph and friends to ILSpy and remove InternalsVisibleTo.
2 years ago
Siegfried Pammer
4bf9487ecd
Remove IsRef, IsOut and IsIn flags from IParameter and Replace ParameterModifiers with ReferenceKind.
2 years ago
Daniel Grunwald
c12187277c
Also use GraphTraversal.DepthFirstSearch for dominance calculation.
3 years ago
Siegfried Pammer
09691bd27e
#3075 : Add NextSetBit operation to BitSet to avoid looking at every store bit individually in ReachingDefinitionsVisitor.GetStores()
3 years ago
Daniel Grunwald
b404bf3aa7
#2480 : avoid crash if ILAst "cannot jump into block container" invariant is violated
5 years ago
Siegfried Pammer
e1ca4db851
Fix #2527 : Support skip locals init
5 years ago
dotnet format
0d9f871a4f
#2128 : Reformat the whole code base.
6 years ago
Siegfried Pammer
eac0e2257e
Support MatchInstruction in DataFlowVisitor
6 years ago
Siegfried Pammer
8925b4ff7b
Inline variable declarations/modernize parts of our code base.
7 years ago
Daniel Grunwald
18ee984ade
Add support for "definitely assigned if true/false" to data flow analysis.
7 years ago
Daniel Grunwald
8cfc21dfab
Fix DefiniteAssignmentVisitor bugs handling ILFunction, and add some comments.
7 years ago
Siegfried Pammer
7d62a7e032
Reset HasInitialValue flag after TransformDisplayClassUsage.
7 years ago
Daniel Grunwald
2929ae865f
Fix #1460 : assertion in DataFlowVisitor`1.DebugPoint() with try-fault statement.
8 years ago
Daniel Grunwald
a86a0586bb
Fix #890 : Correctly handle calls with out-parameters in definite assignment analysis.
9 years ago
Daniel Grunwald
96d9e63f4c
Don't unnecessarily default-initialize variables prior to a call with out-parameter.
9 years ago
Daniel Grunwald
a8a852b742
Add instructions for modeling the "?." operator in the ILAst.
9 years ago
Daniel Grunwald
9ef97703cd
[switch] consider loop back-edges to be exit points when looking for the switch body
9 years ago
Daniel Grunwald
102729cfde
Put switch instructions into their own BlockContainer.
...
This removes the need for "goto case" in the ILAst as we can just branch to the appropriate block.
It also means we can support "break;" within switch using the "leave" instruction (otherwise we'd have to introduce yet another special kind of jump).
9 years ago
Daniel Grunwald
8a68a94d35
Simplify use of SwitchInstruction in ILAst
...
* the default case is now handled as a normal case
* when dealing with basic blocks, SwitchInstruction will be the last instruction in the block
* introduced ILAst instruction for 'goto case'
9 years ago
Daniel Grunwald
0008deb021
Fix handling of try-finally blocks in ReachingDefinitionsVisitor.
...
This was causing variables to get split incorrectly.
9 years ago
Siegfried Pammer
206cdecf30
Merge Return instruction into Leave.
9 years ago
Daniel Grunwald
2207ab40f7
Check the CancellationToken a bit more frequently.
9 years ago
Daniel Grunwald
5621101436
Reconstruct try-finally blocks in yield return decompiler
10 years ago
Daniel Grunwald
fe84ea9730
WIP: yield return decompiler
10 years ago
Siegfried Pammer
0970b95d5f
Rename ILVariable.Scope to Function and introduce BlockContainer CaptureScope
10 years ago
Daniel Grunwald
e871f7c05a
Convert LoopDetection into a block transform.
10 years ago
Siegfried Pammer
840ec04fde
Namespace adjustments for Syntax classes
10 years ago
Christoph Wille
1ce8349dd9
Adjust namespaces
10 years ago
Siegfried Pammer
284ddfadf1
Phase 2: Merge ICSharpCode.NRefactory into ICSharpCode.Decompiler
10 years ago
Daniel Grunwald
7273fe58fd
Add BlockTransform concept and apply a bunch of refactoring essentials suggestions.
10 years ago
Daniel Grunwald
a6fc52a63f
ConditionDetection: move blocks into switch sections
10 years ago
Daniel Grunwald
36d61db3a7
Add support for sparse integer switches.
10 years ago
Daniel Grunwald
9dec6c80a7
LoopDetection: use post-dominance to find better loop exit points
10 years ago
Daniel Grunwald
0e118f0977
LoopDetection: in loops without any exit points, exclude the largest possible code block from the loop
10 years ago
Daniel Grunwald
6d9e53bf4f
Improve ILInlining.IsSafeForInlineOver()
10 years ago
Daniel Grunwald
20aec66815
Initial support for decompiling fixed statements
10 years ago
Daniel Grunwald
a40f0754c1
Add InvalidInstruction to represent invalid IL opcodes in the ILAst instead of crashing.
10 years ago
Daniel Grunwald
5998d39827
Fix bug in DataFlowVisitor.VisitSwitchInstruction
10 years ago
Daniel Grunwald
f3d108c469
Add SplitVariables transforms.
10 years ago
Daniel Grunwald
e21ad7c3e4
DataFlowVisitor: ignore MayThrow and consider every instruction to potentially throw.
...
This brings the IL definite assignment analysis more in line with the C# analysis.
It's arguably more correct, because there are async exceptions (ThreadAbortException).
It also means we call JoinWith() less often, so the analysis should be faster.
10 years ago
Daniel Grunwald
a06ca0c0be
Custom BitSet implementation
10 years ago
Daniel Grunwald
79030f6ee8
DataFlowVisitor: rename IsUnreachable to IsBottom
10 years ago
Daniel Grunwald
1aaf7b3dc0
Fix bugs in data flow analysis.
10 years ago
Daniel Grunwald
f5e66ff623
Extract reusable DataFlowVisitor from ReachingDefinitions; and add ILVariable.HasInitialValue.
10 years ago
Daniel Grunwald
b55775e2cc
Add reaching definitions analysis.
10 years ago
Daniel Grunwald
c171dbd520
Add class VariableScope.
10 years ago
Daniel Grunwald
9e59ea7395
Update System.Collections.Immutable
10 years ago