Skip to content

Commit b693cc2

Browse files
committed
Do not proactively set the stack nested func flag on recompiled functions. If the function has been compiled previously, the stack nested func flag already has the correct value, and resetting it may ignore an escape that has since been discovered.
1 parent 19f0867 commit b693cc2

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

lib/Runtime/ByteCode/ByteCodeEmitter.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3061,7 +3061,9 @@ void ByteCodeGenerator::EmitOneFunction(ParseNode *pnode)
30613061

30623062
if (!funcInfo->IsGlobalFunction())
30633063
{
3064-
if (CanStackNestedFunc(funcInfo, true))
3064+
// Note: Do not set the stack nested func flag if the function has been redeferred and recompiled.
3065+
// In that case the flag already has the value we want.
3066+
if (CanStackNestedFunc(funcInfo, true) && byteCodeFunction->GetCompileCount() == 0)
30653067
{
30663068
#if DBG
30673069
byteCodeFunction->SetCanDoStackNestedFunc();

0 commit comments

Comments
 (0)