From 6eba63d1851b4ece1e334ea1e07b3af44ef1e480 Mon Sep 17 00:00:00 2001 From: Matt Gardner Date: Thu, 7 Sep 2017 12:02:50 -0700 Subject: [PATCH] [CVE-2017-11796] Don't reset envDepths for nested compiled functions --- lib/Runtime/ByteCode/ByteCodeEmitter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Runtime/ByteCode/ByteCodeEmitter.cpp b/lib/Runtime/ByteCode/ByteCodeEmitter.cpp index 482f4503193..f3e882b1507 100644 --- a/lib/Runtime/ByteCode/ByteCodeEmitter.cpp +++ b/lib/Runtime/ByteCode/ByteCodeEmitter.cpp @@ -3481,7 +3481,7 @@ void ByteCodeGenerator::StartEmitFunction(ParseNode *pnodeFnc) FuncInfo *funcInfo = pnodeFnc->sxFnc.funcInfo; - if (funcInfo->byteCodeFunction->IsFunctionParsed()) + if (funcInfo->byteCodeFunction->IsFunctionParsed() && funcInfo->GetParsedFunctionBody()->GetByteCode() == nullptr) { if (!(flags & (fscrEval | fscrImplicitThis | fscrImplicitParents))) {