From a917ce2369643c56b0718a95d433a6613e2d2505 Mon Sep 17 00:00:00 2001 From: Aneesh Divakarakurup Date: Mon, 31 Jul 2017 12:18:50 -0700 Subject: [PATCH] When ForceSplitScope flag is provided don't assume that we have non-simple parameter list When we force all functions to have split scope we shouldn't assume that those function have non-simple parameter list. Fixed couple of places in EmitOneFunction. --- lib/Runtime/ByteCode/ByteCodeEmitter.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/Runtime/ByteCode/ByteCodeEmitter.cpp b/lib/Runtime/ByteCode/ByteCodeEmitter.cpp index 42f2edee1dd..d52e1962769 100644 --- a/lib/Runtime/ByteCode/ByteCodeEmitter.cpp +++ b/lib/Runtime/ByteCode/ByteCodeEmitter.cpp @@ -3351,8 +3351,10 @@ void ByteCodeGenerator::EmitOneFunction(ParseNode *pnode) DefineLabels(funcInfo); - if (pnode->sxFnc.HasNonSimpleParameterList()) + if (pnode->sxFnc.HasNonSimpleParameterList() || !funcInfo->IsBodyAndParamScopeMerged()) { + Assert(pnode->sxFnc.HasNonSimpleParameterList() || CONFIG_FLAG(ForceSplitScope)); + this->InitBlockScopedNonTemps(funcInfo->root->sxFnc.pnodeScopes, funcInfo); EmitDefaultArgs(funcInfo, pnode); @@ -3395,8 +3397,9 @@ void ByteCodeGenerator::EmitOneFunction(ParseNode *pnode) DefineUserVars(funcInfo); - if (pnode->sxFnc.HasNonSimpleParameterList()) + if (pnode->sxFnc.HasNonSimpleParameterList() || !funcInfo->IsBodyAndParamScopeMerged()) { + Assert(pnode->sxFnc.HasNonSimpleParameterList() || CONFIG_FLAG(ForceSplitScope)); this->InitBlockScopedNonTemps(funcInfo->root->sxFnc.pnodeBodyScope, funcInfo); } else