File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -761,7 +761,11 @@ void InterpCompiler::EmitCode()
761
761
762
762
// These will eventually be freed by the VM, and they use the delete [] operator for the deletion.
763
763
m_pILToNativeMap = new ICorDebugInfo::OffsetMapping[m_ILCodeSize];
764
- ICorDebugInfo::NativeVarInfo* eeVars = new ICorDebugInfo::NativeVarInfo[m_numILVars];
764
+ ICorDebugInfo::NativeVarInfo* eeVars = NULL ;
765
+ if (m_numILVars > 0 )
766
+ {
767
+ eeVars = new ICorDebugInfo::NativeVarInfo[m_numILVars];
768
+ }
765
769
766
770
int32_t *ip = m_pMethodCode;
767
771
for (InterpBasicBlock *bb = m_pEntryBB; bb != NULL ; bb = bb->pNextBB )
@@ -794,7 +798,10 @@ void InterpCompiler::EmitCode()
794
798
j++;
795
799
}
796
800
797
- m_compHnd->setVars (m_methodInfo->ftn , m_numILVars, eeVars);
801
+ if (m_numILVars > 0 )
802
+ {
803
+ m_compHnd->setVars (m_methodInfo->ftn , m_numILVars, eeVars);
804
+ }
798
805
m_compHnd->setBoundaries (m_methodInfo->ftn , m_ILToNativeMapSize, m_pILToNativeMap);
799
806
}
800
807
@@ -1787,6 +1794,7 @@ int InterpCompiler::GenerateCode(CORINFO_METHOD_INFO* methodInfo)
1787
1794
1788
1795
if ((methodInfo->options & CORINFO_OPT_INIT_LOCALS) && m_ILLocalsSize > 0 )
1789
1796
{
1797
+ m_currentILOffset = 0 ;
1790
1798
AddIns (INTOP_INITLOCALS);
1791
1799
m_pLastNewIns->data [0 ] = m_ILLocalsOffset;
1792
1800
m_pLastNewIns->data [1 ] = m_ILLocalsSize;
You can’t perform that action at this time.
0 commit comments