Siegfried Pammer
760a3ad9e1
Add pretty tests for pointer-to-pointer shapes
...
The UnsafeCode fixture had no double-indirection coverage at all:
no pointer-to-pointer loads, stores, or indexing, and no fixed
statement over an element of a pointer array.
Assisted-by: Claude:claude-fable-5:Claude Code
3 days ago
Siegfried Pammer
94050a4aca
Rewrite TransformFieldAndConstructorInitializers from a step-by-step AST-based analysis to an analysis that tracks the whole constructor body.
8 months ago
Peter Crabtree
e1e16b64f5
dev: Strip BOM mark from text files
10 months ago
ds5678
d75da053a8
Use type hint in pointer arithmetic when appropriate
1 year ago
Siegfried Pammer
3fb153940b
AssignVariableNames: Handle fixed statement special cases
2 years ago
Daniel Grunwald
efeaf1356f
Add feature: C#11 nint without NativeIntegerAttribute
...
Because it is no longer possible to distinguish IntPtr from nint, this required a lot of testcase adjustment.
3 years ago
Siegfried Pammer
b87f3753e2
Fix #2786 : Structs with static reference type fields not recognized as unmanaged
4 years ago
Siegfried Pammer
3c2e52854e
DetectPinnedRegions: Inline the stack-slot involved in CustomRefPinPattern so that the following ProcessPinnedRegion call can reuse existing unmanaged pointer variables instead of being forced to create a new variable.
4 years ago
Siegfried Pammer
f98012ec16
DetectPinnedRegions: Support special case where pinned pointer is unused and the compiler optimized out the StopGCTracking-conversion.
4 years ago
Siegfried Pammer
44dee6ecc2
Add additional tests for .NET 4.0
4 years ago
Daniel Grunwald
1292ff70d9
Fix #2391 : mark method as unsafe when passing `null` to a parameter of pointer type.
5 years ago
Daniel Grunwald
8d70d63dba
#2392 : Avoid some redundant casts with the `?:` operator.
5 years ago
Daniel Grunwald
51b3cf51c6
Fix #2305 : Cast to integer type where necessary in managed pointer arithmetic.
5 years ago
Daniel Grunwald
b4c5c0d212
Fix #2287 : Prefer `ref target.field[0]` over `ref *target.field`
5 years ago
Daniel Grunwald
a26a25d689
Fix #2158 : Remove PointerType support from CSharpResolver for additions/subtractions.
...
These have special semantics (number of elements in C# vs. number of bytes in IL), and so pointer arithmetic must go through the special HandlePointerArithmetic() code path --> the normal logic in HandleBinaryNumeric must not ever emit pointer arithmetic.
6 years ago
Daniel Grunwald
5c6b9897c1
Avoid redundant casts + adjust NoExtensionMethods ugly test.
6 years ago
dotnet format
0d9f871a4f
#2128 : Reformat the whole code base.
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
Daniel Grunwald
bbb2397083
Fix #1853 : Detect pinning of multi-dimensional array
7 years ago
Daniel Grunwald
e9eac88dc8
Comment out failing test case -- the get.pinnable.reference transform isn't ready yet
7 years ago
Daniel Grunwald
eb2a9e6b94
#1852 : Rename array.to.pointer opcode to get.pinnable.reference.
7 years ago
Daniel Grunwald
703d21bafa
Support C# 7.3 pattern-based fixed statement.
7 years ago
Siegfried Pammer
09ea089d8a
Fix #1499 , fix #1502
7 years ago
Daniel Grunwald
f6aae1f97d
Fix #1386 : MoveArrayToPointerToPinnedRegionInit: Only consider the pinned variable uses within the PinnedRegion
...
This also makes CleanUpTryFinallyAroundPinnedRegion() redundant as it is no longer necessary to trigger the array-to-pointer transform; so the normal elimination of pinned variable resets is sufficient.
7 years ago
Daniel Grunwald
da5693e605
Fix #1339 : fixed statement not decompiled correctly when pinned variable is reset in finally block
7 years ago
Daniel Grunwald
d8c8a75c2e
Fix #1154 : Decompilation of fixed statement when pointer variable is unused
8 years ago
Daniel Grunwald
7b8389dca5
Fix #1078 : Eliminate redundant variable in fixed statements.
8 years ago
Siegfried Pammer
5dd7eaf129
Fix #1093 : Remove usage of type or this qualifiers, when possible.
8 years ago
Daniel Grunwald
b9337c6129
Fix #1021 : Compound assignments on pointer types.
8 years ago
Daniel Grunwald
b3c176e39a
Prefer '#if CS60' over '#if !LEGACY_CSC'
8 years ago
Siegfried Pammer
a957163aa3
Fix unit tests
8 years ago
Siegfried Pammer
df04b40951
Fix #990 : Invalid object cast for virtual call through pointer
9 years ago
Siegfried Pammer
86c3ab8314
Fix unit tests
9 years ago
Daniel Grunwald
76c68e4ed4
Fix decompilation of "unsafePtr[1].Field = ...;"
9 years ago
Daniel Grunwald
7f7e6564b3
Fix #948 : fix assertion when accessing fixed-size fields where StackType.Ref is expected.
9 years ago
Siegfried Pammer
4d5d4b3d6b
Fix #952 : Issue with discard expressions and variables
9 years ago
Siegfried Pammer
20f772172c
Fix #949 : Unsafe modifier missing in some cases
9 years ago
Daniel Grunwald
0357c81c44
Move stackalloc tests to pretty-tests.
9 years ago
Daniel Grunwald
0c6d6742fe
Add support for fixed-size buffers.
9 years ago
Daniel Grunwald
bab93ee990
Fix pointer arithmetic involving pointer to structs and long offsets.
9 years ago
Daniel Grunwald
74eb0d8d63
Avoid unnecessary casts in pointer comparisons.
9 years ago
Daniel Grunwald
8c5de98a39
Move UnsafeCode tests to pretty-tests (except for those that are not yet successful).
9 years ago
Daniel Grunwald
dc995b15c6
Add support for 'ptr - ptr'.
9 years ago
Daniel Grunwald
19a7d8f7ff
Add support for pointer arithmetic (ptr + offset, offset + ptr, ptr - offset).
9 years ago
Siegfried Pammer
e26af08a1c
Move test projects to their own directory in \
9 years ago
Siegfried Pammer
f24f1e007e
Move correctness tests to single namespace
10 years ago
Daniel Grunwald
f55a93011d
Fix decompilation of PointerReferenceExpression
10 years ago
Daniel Grunwald
385048f32c
Fix stackalloc[] decompilation.
10 years ago
Siegfried Pammer
6c57304684
Reorganize TestRunner-Tests
10 years ago
Daniel Grunwald
20aec66815
Initial support for decompiling fixed statements
10 years ago