Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 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
12 changes: 4 additions & 8 deletions src/coreclr/interpreter/compiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2506,17 +2506,13 @@ void InterpCompiler::EmitCall(CORINFO_RESOLVED_TOKEN* constrainedClass, bool rea
}
m_pLastNewIns->data[0] = GetDataItemIndex(callInfo.hMethod);
}
else if ((callInfo.classFlags & CORINFO_FLG_ARRAY) && !readonly)
else if ((callInfo.classFlags & CORINFO_FLG_ARRAY) && newObj)
{
CORINFO_SIG_INFO ctorSignature;
CORINFO_CLASS_HANDLE ctorClass;

m_compHnd->getMethodSig(resolvedCallToken.hMethod, &ctorSignature);
ctorClass = m_compHnd->getMethodClass(resolvedCallToken.hMethod);
CORINFO_CLASS_HANDLE arrayClsHnd = m_compHnd->getMethodClass(resolvedCallToken.hMethod);

AddIns(INTOP_NEWMDARR);
m_pLastNewIns->data[0] = GetDataItemIndex(ctorClass);
m_pLastNewIns->data[1] = numArgs;
m_pLastNewIns->data[0] = GetDataItemIndex(arrayClsHnd);
m_pLastNewIns->data[1] = callInfo.sig.numArgs;
}
else
{
Expand Down
8 changes: 4 additions & 4 deletions src/coreclr/vm/interpexec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,15 +132,15 @@ static void InterpBreakpoint()
}
#endif

static OBJECTREF CreateMultiDimArray(MethodTable* arrayClass, int8_t* stack, int32_t dimsOffset, int rank)
static OBJECTREF CreateMultiDimArray(MethodTable* arrayClass, int8_t* stack, int32_t dimsOffset, int numArgs)
{
int32_t* dims = (int32_t*)alloca(rank * sizeof(int32_t));
for (int i = 0; i < rank; i++)
int32_t* dims = (int32_t*)alloca(numArgs * sizeof(int32_t));
for (int i = 0; i < numArgs; i++)
{
dims[i] = *(int32_t*)(stack + dimsOffset + i * 8);
}

return AllocateArrayEx(arrayClass, dims, rank);
return AllocateArrayEx(arrayClass, dims, numArgs);
}

#define LOCAL_VAR_ADDR(offset,type) ((type*)(stack + (offset)))
Expand Down