From a79ee4dcf247d84a0718b4bc7f17dc9c9d9e8b6d Mon Sep 17 00:00:00 2001 From: Sergey Andreenko Date: Mon, 9 Oct 2017 16:30:07 -0700 Subject: [PATCH] do not spill stack after CEE_NEWARR and CEE_NEWOBJ. Fixes coreRT issue with "InitializeArray intrinsic must always be expanded". --- src/jit/importer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/jit/importer.cpp b/src/jit/importer.cpp index 73310076211a..afd637d06884 100644 --- a/src/jit/importer.cpp +++ b/src/jit/importer.cpp @@ -2587,9 +2587,9 @@ inline IL_OFFSETX Compiler::impCurILOffset(IL_OFFSET offs, bool callInstruction) // true if it is legal, false if it could be a sequence that we do not want to divide. bool Compiler::impCanSpillNow(OPCODE prevOpcode) { - // Don't spill after ldtoken, because it could be a part of the InitializeArray sequence. + // Don't spill after ldtoken, newarr and newobj, because it could be a part of the InitializeArray sequence. // Avoid breaking up to guarantee that impInitializeArrayIntrinsic can succeed. - return prevOpcode != CEE_LDTOKEN; + return (prevOpcode != CEE_LDTOKEN) && (prevOpcode != CEE_NEWARR) && (prevOpcode != CEE_NEWOBJ); } /*****************************************************************************