-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Closed
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 SuperPMI
Milestone
Description
NGenDump leading to the assert: ngendump.txt
Compile the below with:
csc /noconfig /nostdlib cse.cs /r:System.Private.CoreLib.dll /O /unsafe /target:librarycrossgen cse.dll
using System.Runtime.InteropServices;
using System;
using System.Diagnostics;
[StructLayout(LayoutKind.Sequential)]
struct DynamicFieldHandleInfo
{
public IntPtr DeclaringType;
public IntPtr FieldName;
}
class Foo
{
public string GetStringFromMemoryInNativeFormat(IntPtr p) => null;
private unsafe bool TryGetDynamicRuntimeFieldHandleComponents(RuntimeFieldHandle runtimeFieldHandle, out RuntimeTypeHandle declaringTypeHandle, out string fieldName)
{
IntPtr runtimeFieldHandleValue = *(IntPtr*)&runtimeFieldHandle;
// Special flag in the handle value to indicate it was dynamically allocated
Debug.Assert((runtimeFieldHandleValue.ToInt64() & 0x1) == 0x1);
runtimeFieldHandleValue = runtimeFieldHandleValue - 1;
DynamicFieldHandleInfo* fieldData = (DynamicFieldHandleInfo*)runtimeFieldHandleValue.ToPointer();
declaringTypeHandle = *(RuntimeTypeHandle*)&(fieldData->DeclaringType);
// FieldName points to the field name in NativeLayout format, so we parse it using a NativeParser
IntPtr fieldNamePtr = fieldData->FieldName;
fieldName = GetStringFromMemoryInNativeFormat(fieldNamePtr);
return true;
}
}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 SuperPMI