Skip to content

Commit

Permalink
When ForceSplitScope flag is provided don't assume that we have non-s…
Browse files Browse the repository at this point in the history
…imple 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.
  • Loading branch information
aneeshdk committed Jul 31, 2017
1 parent 0dd871b commit a917ce2
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/Runtime/ByteCode/ByteCodeEmitter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit a917ce2

Please sign in to comment.