Skip to content

Commit d2fec40

Browse files
committed
[MERGE #5162 @pleath] [MSFT 16727746] Do not leave a null slot in the frame display when generating code for an eval
Merge pull request #5162 from pleath:16727746 Load/store of undeclared properties will traverse the entire frame display, including this slot.
2 parents 9f3f947 + 1820d0c commit d2fec40

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/Runtime/ByteCode/ByteCodeGenerator.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3061,9 +3061,10 @@ FuncInfo* PostVisitFunction(ParseNodeFnc* pnodeFnc, ByteCodeGenerator* byteCodeG
30613061
}
30623062
#endif
30633063
}
3064-
else if (!top->GetHasLocalInClosure())
3064+
else if (!top->GetHasLocalInClosure() && !(byteCodeGenerator->GetFlags() & fscrEval) && !top->byteCodeFunction->IsEval())
30653065
{
30663066
//Scope object creation instr will be a MOV NULL instruction in the Lowerer - if we still decide to do StackArgs after Globopt phase.
3067+
//Note that if we're in eval, scoped ldfld/stfld will traverse the whole frame display, including this slot, so it can't be null.
30673068
top->byteCodeFunction->SetDoScopeObjectCreation(false);
30683069
}
30693070
}

0 commit comments

Comments
 (0)