Skip to content

CreateArray now takes caller parameter #3165

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

Merged
merged 1 commit into from
Apr 30, 2025
Merged
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
5 changes: 3 additions & 2 deletions src/CLR/Core/CLR_RT_HeapBlock_Array.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ HRESULT CLR_RT_HeapBlock_Array::CreateInstance(
CLR_RT_HeapBlock &reference,
CLR_UINT32 length,
CLR_RT_Assembly *assm,
CLR_UINT32 tk)
CLR_UINT32 tk,
const CLR_RT_MethodDef_Instance *caller)
{
NATIVE_PROFILE_CLR_CORE();
NANOCLR_HEADER();
Expand All @@ -97,7 +98,7 @@ HRESULT CLR_RT_HeapBlock_Array::CreateInstance(

memset(&ref, 0, sizeof(struct CLR_RT_HeapBlock));

if (cls.ResolveToken(tk, assm))
if (cls.ResolveToken(tk, assm, caller))
{
ref.SetReflection(cls);
}
Expand Down
2 changes: 1 addition & 1 deletion src/CLR/Core/Interpreter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2851,7 +2851,7 @@ HRESULT CLR_RT_Thread::Execute_IL(CLR_RT_StackFrame &stackArg)

for (int pass = 0; pass < 2; pass++)
{
hr = CLR_RT_HeapBlock_Array::CreateInstance(evalPos[0], size, assm, arg);
hr = CLR_RT_HeapBlock_Array::CreateInstance(evalPos[0], size, assm, arg, &stack->m_call);
if (SUCCEEDED(hr))
{
break;
Expand Down
7 changes: 6 additions & 1 deletion src/CLR/Include/nanoCLR_Runtime__HeapBlock.h
Original file line number Diff line number Diff line change
Expand Up @@ -1839,7 +1839,12 @@ struct CLR_RT_HeapBlock_Array : public CLR_RT_HeapBlock
CLR_UINT32 length,
const CLR_RT_ReflectionDef_Index &reflex);
static HRESULT CreateInstance(CLR_RT_HeapBlock &reference, CLR_UINT32 length, const CLR_RT_TypeDef_Index &cls);
static HRESULT CreateInstance(CLR_RT_HeapBlock &reference, CLR_UINT32 length, CLR_RT_Assembly *assm, CLR_UINT32 tk);
static HRESULT CreateInstance(
CLR_RT_HeapBlock &reference,
CLR_UINT32 length,
CLR_RT_Assembly *assm,
CLR_UINT32 tk,
const CLR_RT_MethodDef_Instance *caller);

CLR_UINT8 *GetFirstElement()
{
Expand Down
Loading