Skip to content

Fix box/unbox Nullable<T> types #3199

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 10 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/CLR/CorLib/corlib_native.h
Original file line number Diff line number Diff line change
Expand Up @@ -644,6 +644,14 @@ struct Library_corlib_native_System_MulticastDelegate
//--//
};

struct Library_corlib_native_System_Nullable_1
{
static const int FIELD__hasValue = 1;
static const int FIELD__value = 2;

//--//
};

struct Library_corlib_native_System_Number
{
NANOCLR_NATIVE_DECLARE(FormatNative___STATIC__STRING__OBJECT__BOOLEAN__STRING__STRING__STRING__STRING__SZARRAY_I4);
Expand Down
13 changes: 2 additions & 11 deletions src/CLR/Core/CLR_RT_HeapBlock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -349,21 +349,12 @@ HRESULT CLR_RT_HeapBlock::SetObjectCls(const CLR_RT_TypeDef_Index &cls)
NANOCLR_NOCLEANUP();
}

HRESULT CLR_RT_HeapBlock::SetGenericInstanceObject(const CLR_RT_TypeSpec_Index &genericType)
HRESULT CLR_RT_HeapBlock::SetGenericInstanceType(const CLR_RT_TypeSpec_Index &genericType)
{
NATIVE_PROFILE_CLR_CORE();
NANOCLR_HEADER();

CLR_RT_TypeSpec_Instance instance;

if (instance.InitializeFromIndex(genericType) == false)
{
NANOCLR_SET_AND_LEAVE(CLR_E_FAIL);
}

m_data.genericInstance.genericType = genericType;
m_data.genericInstance.ptr = nullptr;
m_id.raw = CLR_RT_HEAPBLOCK_RAW_ID(DATATYPE_GENERICINST, 0, 1);
m_data.reflection.data.genericType = genericType;

NANOCLR_NOCLEANUP();
}
Expand Down
Loading
Loading