From 295e24c01618ff3196e7bd7df60c21099ef28872 Mon Sep 17 00:00:00 2001 From: Brian Sullivan Date: Fri, 6 Jul 2018 14:33:36 -0700 Subject: [PATCH] Updated fix for VSO 610014 --- src/jit/compiler.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/jit/compiler.cpp b/src/jit/compiler.cpp index f28394b..e547876 100644 --- a/src/jit/compiler.cpp +++ b/src/jit/compiler.cpp @@ -6719,17 +6719,18 @@ START: } finallyErrorTrap() { - // Add a dummy touch to pComp so that it is kept alive, and is easy to get to - // during debugging since all other data can be obtained through it. + Compiler* pCompiler = pParamOuter->pComp; + + // If OOM is thrown when allocating memory for a pComp, we will end up here. + // For this case, pComp and also pCompiler will be a nullptr // - if (pParamOuter->pComp) // If OOM is thrown when allocating memory for pComp, we will end up here. - // In that case, pComp is still NULL. + if (pCompiler != nullptr) { - pParamOuter->pComp->info.compCode = nullptr; + pCompiler->info.compCode = nullptr; // pop the compiler off the TLS stack only if it was linked above - assert(JitTls::GetCompiler() == pParamOuter->pComp); - JitTls::SetCompiler(JitTls::GetCompiler()->prevCompiler); + assert(JitTls::GetCompiler() == pCompiler); + JitTls::SetCompiler(pCompiler->prevCompiler); } if (pParamOuter->inlineInfo == nullptr) -- 2.7.4