Skip to content

Commit 619c2fc

Browse files
committed
2 very simple redeferral fixes: 1. Now that the ScopeSlots structure uses a FunctionInfo*, make sure that the FunctionInfo points to a full FunctionBody before attempting to box a StackScriptFunction. 2. In addition to changing the type's entry point when we redefer, make sure we change a ScriptFunctionType's entry point info's type. This is necessary in the case of a cross-site call to a redeferred function.
1 parent ee8e57e commit 619c2fc

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

lib/Runtime/Base/FunctionBody.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -900,6 +900,10 @@ namespace Js
900900
{
901901
functionType->SetEntryPoint(GetScriptContext()->DeferredParsingThunk);
902902
}
903+
if (!CrossSite::IsThunk(functionType->GetEntryPointInfo()->jsMethod))
904+
{
905+
functionType->GetEntryPointInfo()->jsMethod = GetScriptContext()->DeferredParsingThunk;
906+
}
903907
});
904908

905909
this->Cleanup(false);

lib/Runtime/Library/StackScriptFunction.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -349,8 +349,8 @@ namespace Js
349349
ScopeSlots slots(slotArray);
350350
if (slots.IsFunctionScopeSlotArray())
351351
{
352-
FunctionBody *functionBody = slots.GetFunctionInfo()->GetFunctionBody();
353-
if (this->NeedBoxFrame(functionBody))
352+
FunctionProxy *functionProxy = slots.GetFunctionInfo()->GetFunctionProxy();
353+
if (functionProxy->IsFunctionBody() && this->NeedBoxFrame(functionProxy->GetFunctionBody()))
354354
{
355355
break;
356356
}

0 commit comments

Comments
 (0)