Daniel Grunwald
dc6e094a30
Add support for indexing arrays using System.Index
6 years ago
Daniel Grunwald
4846feb640
Add support for C# 8 range syntax.
...
This initial commit only handles the trivial case where an Index or Range object is constructed.
The TODO portions of the test case show there are plenty of cases where where the C# compiler emits more complex code patterns that will require ILAst transforms.
6 years ago
Daniel Grunwald
5ad7ee0cea
Fix #1629 : Add support for `[module: NullablePublicOnly]`
...
If this attribute is in use, private/internal members lack nullability annotations.
Previously in such cases, we ended up inheriting the nullability from the `[NullableContext]`, which could cause us to display a misleading nullability for primary methods.
In debug builds, it could also trigger an assertion when trying to apply the "nullable reference type" marking to to value types.
Of note is that properties and events are a special case: they do not explicitly store Accessibility in metadata. For properties computing the accessibility requires decoding the signature (to find overridden base properties). So these two only check the declaring type's accessibility instead; private properties may still carry nullability despite `[NullablePublicOnly]`. However, the property accessors won't store nullability, so we need to read the `returnTypeAttributes` from the property itself.
6 years ago
Siegfried Pammer
24810cb2e8
use ILInstruction.StartILOffset instead of ILRanges.First().Start
...
Co-Authored-By: Daniel Grunwald <daniel@danielgrunwald.de>
6 years ago
Siegfried Pammer
8925b4ff7b
Inline variable declarations/modernize parts of our code base.
6 years ago
Siegfried Pammer
e2df79ef70
Fix #1975 : readonly modifier is added to structs even if language version is lower than C# 7.0
6 years ago
Siegfried Pammer
91e9573449
Fix #1976 : ProxyCallReplacer should honor selected language version/selected options
6 years ago
Siegfried Pammer
d09190533a
Fix #1980 : IndexOutOfRangeException when choose `IL with C#` with System.Runtime.CompilerServices.Unsafe.Copy/InitBlock
6 years ago
Siegfried Pammer
10e3da3d16
Add missing license headers to MIT licensed files in ICSharpCode.Decompiler
6 years ago
Siegfried Pammer
853cad5fd0
Disassembler: Implement cancellation token.
6 years ago
Siegfried Pammer
4db41f69db
Fix #1919 : Use unmapped IL offsets at the start of a catch-block for the 'exception specifier' sequence point.
6 years ago
Siegfried Pammer
ba5c645257
Add TryCatchHandler annotation to CatchClause
6 years ago
Siegfried Pammer
e029266d40
Fix tokens used for catch-when clause.
6 years ago
Siegfried Pammer
c293613a56
Add ExceptionSpecifierILRange to TryCatchHandler
6 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.
6 years ago
Daniel Grunwald
65fe59e393
#1918 : Fix a bunch of issues with pinned region detection.
...
Not every pinned region has a clean `P = null` assignment to mark its end.
If a second pinned region starts with the same variable `P`, consider that to mark the end of the previous pinned region for that variable.
Also, fix a bunch of special cases with empty pinned regions.
6 years ago
Siegfried Pammer
69ac54fbb6
Fix #1879 : Do not remove variables that look like display class variables, but are used in other patterns as well.
6 years ago
Daniel Grunwald
ff40fbd984
Fix #1958 : Emit ProjectTypeGuids when generating .csproj
...
For portable class libraries, the type GUID is required so that Visual Studio for Mac can open the project.
6 years ago
Daniel Grunwald
fb5ab19bfd
SolutionCreator: Store project type GUID in .sln
6 years ago
Daniel Grunwald
0cf50aa827
Fix #1959 : Resolve the "F(G<A,B>(7));" grammar ambiguity by inserting parentheses when necessary.
6 years ago
Siegfried Pammer
5ee172d4c4
Fix #1900 : RemoveDeadVariableInit.ResetHasInitialValueFlag should handle local functions
6 years ago
Siegfried Pammer
371d732c0a
Fix #1881 : Not properly reusing names from PDB#2
6 years ago
Siegfried Pammer
e748e71b56
Implement workaround for #1961
6 years ago
Siegfried Pammer
7c7328df32
Fix #1955 : struct 'base' access to ValueType mis-decompiles
6 years ago
Siegfried Pammer
7d1d7b2563
Fix EndLocation of double-typed PrimitiveExpression
6 years ago
Siegfried Pammer
c2a2cf43f2
Fix #1482 : SequencePointBuilder fails with an assertion when trying to create sequence points for LINQ expressions
6 years ago
Christoph Wille
ed7af2addb
Windows: keep using Windows PowerShell, other OSs fall back on pwsh (to reduce deps to get up and running on Windows)
6 years ago
Siegfried Pammer
a7d1d8fad7
TransformNullPropagationOnUnconstrainedGenericExpression: handle pattern that uses leave instructions instead of stloc into a temporary.
6 years ago
Siegfried Pammer
95beaddc80
IntroduceQueryExpressions: Inline variable declarations and use pattern matching syntax where possible.
6 years ago
Siegfried Pammer
69cad7527e
Fix #1945 , fix #1851 : NRE when generating sequence points for a method containing a stackalloc expression.
6 years ago
Siegfried Pammer
010abebcc9
Fix #1050 : Implement TransformNullPropagationOnUnconstrainedGenericExpression
6 years ago
Siegfried Pammer
413c5b3baf
PortablePdbWriter: Add primitive support for state-machine hoisted local scopes. All variables are visible in the whole MoveNext method.
6 years ago
Siegfried Pammer
54a742f3f5
Metadata Explorer: Display blob contents of custom debug information in tooltip.
6 years ago
Siegfried Pammer
3f108cea37
#1482 : Fix sequence points of LINQ select and where.
6 years ago
Daniel Grunwald
3bf9f7c301
Fix #1943 : "ref readonly" returns from properties/indexers
6 years ago
Siegfried Pammer
22799ca6b1
#1942 : Make sure to group all types by filename in the generated PDB.
6 years ago
Siegfried Pammer
70b087bf8d
#1942 : WholeProjectDecompiler: Do not use filenames that collide with names of special devices. Note: this changes the PDB structure from multi-level folders per namespace to "dotted name" folders.
6 years ago
Christoph Wille
55a6f9184f
Use PowerShell Core for running update-assemblyinfo.ps1
6 years ago
Siegfried Pammer
bef75321fb
#1913 : Do not destroy control-flow by removing return statements
6 years ago
Siegfried Pammer
df84ab8f6b
Fix #1882 : Provide a setting to desugar X? into Nullable<X> for value types
6 years ago
Siegfried Pammer
73e0f7c3ac
Fix #1936 : TransformDisplayClassUsage should remove copies of display-class references.
6 years ago
Siegfried Pammer
67b7ad362a
Started documenting SequencePointBuilder
6 years ago
Siegfried Pammer
e4fda5c2e4
Rename HasILRange to ILRangeIsEmpty to properly reflect its implementation.
6 years ago
Siegfried Pammer
5d622056a1
Add TranslatedStatement: require that C# statements must be annotated with their corresponding ILInstructions.
6 years ago
Siegfried Pammer
e2b10adc72
Fix #1927 : NRE in ExpressionBuilder when trying to decompile catch-when blocks consisting of multiple statements.
6 years ago
Daniel Grunwald
9e82b95373
Fix hexadecimal format of flags enum member initializers.
6 years ago
Daniel Grunwald
ad5ba9295e
Fix #1924 : preserve hexadecimal format when converting literal to wider type
6 years ago
Daniel Grunwald
a7446cfddf
#1922 : Refactor PrimitiveExpression to store the literal format in the AST
6 years ago
Daniel Grunwald
8d780cc921
#1922 : Fix hexadecimal integer literals missing the `uL` suffix.
6 years ago
Daniel Grunwald
4b1f0b342c
Fix #1925 : Adjust AsyncAwaitDecompiler to changes in Roslyn 3.5.0-beta2
6 years ago