-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Closed
Closed
Copy link
Labels
area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMICLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMIbugin-prThere is an active PR which will close this issue when it is mergedThere is an active PR which will close this issue when it is merged
Milestone
Description
Reproduction:
Console.WriteLine((nint)Problem(null));
[MethodImpl(MethodImplOptions.NoInlining)]
static int* Problem(StructWithIndex* s)
{
return &s->Index;
}
struct StructWithIndex
{
public int Index;
public int Value;
}Compile and run.
Expected result: a NullReferenceException is thrown.
Actual result: 0 is printed.
Cause: odd code in fgMorphField that special-cases fields with zero offsets.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMICLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMIbugin-prThere is an active PR which will close this issue when it is mergedThere is an active PR which will close this issue when it is merged