Skip to content

Commit feda13a

Browse files
committed
Always initialize locals
1 parent 0a41ac0 commit feda13a

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

src/coreclr/interpreter/compiler.cpp

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2087,18 +2087,10 @@ int InterpCompiler::GenerateCode(CORINFO_METHOD_INFO* methodInfo)
20872087
// We need to always generate this opcode because even if we have no IL locals, we may have
20882088
// global vars which contain managed pointers or interior pointers
20892089
m_pInitLocalsIns = AddIns(INTOP_INITLOCALS);
2090-
2091-
if (methodInfo->options & CORINFO_OPT_INIT_LOCALS)
2092-
{
2093-
m_pInitLocalsIns->data[0] = m_ILLocalsOffset;
2094-
m_pInitLocalsIns->data[1] = m_ILLocalsSize;
2095-
}
2096-
else
2097-
{
2098-
// Generate a 0-byte memset at the *end* of IL locals so when we extend it later we won't zero the IL locals
2099-
m_pInitLocalsIns->data[0] = m_ILLocalsOffset + m_ILLocalsSize;
2100-
m_pInitLocalsIns->data[1] = 0;
2101-
}
2090+
// if (methodInfo->options & CORINFO_OPT_INIT_LOCALS)
2091+
// FIXME: We can't currently skip zeroing locals because we don't have accurate liveness for global refs and byrefs
2092+
m_pInitLocalsIns->data[0] = m_ILLocalsOffset;
2093+
m_pInitLocalsIns->data[1] = m_ILLocalsSize;
21022094

21032095
codeEnd = m_ip + m_ILCodeSize;
21042096

0 commit comments

Comments
 (0)