Skip to content

Commit cf6ed6f

Browse files
committed
Fix redeferral for deserialized DeferDeserializeFunctionInfo functions
When DeferDeserializeFunctionInfo transitions into a FunctionBody during Deserialize, the deferredPrototypeType and undeferredFunctionType from FunctionProxy are not copied into the FunctionBody because copying them is only done in ParseableFunctionInfo::Copy (DeferDeserializeFunctionInfo does not call this). If the FunctionBody is then redeferred, we'll fail to reset the type since it wasn't saved. Fix is to copy these two fields in FunctionProxy::Copy which is called by DeferDeserializeFunctionInfo::Deserialize.
1 parent 05331f9 commit cf6ed6f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/Runtime/Base/FunctionBody.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1433,6 +1433,11 @@ namespace Js
14331433
{
14341434
other->SetIsJsBuiltInCode();
14351435
}
1436+
1437+
#define CopyDeferParseField(field) other->field = this->field;
1438+
CopyDeferParseField(deferredPrototypeType);
1439+
CopyDeferParseField(undeferredFunctionType);
1440+
#undef CopyDeferParseField
14361441
}
14371442

14381443
void ParseableFunctionInfo::Copy(ParseableFunctionInfo * other)
@@ -1466,8 +1471,6 @@ namespace Js
14661471
other->SetCachedSourceStringWeakRef(this->GetCachedSourceStringWeakRef());
14671472
CopyDeferParseField(m_isAsmjsMode);
14681473
CopyDeferParseField(m_isAsmJsFunction);
1469-
CopyDeferParseField(deferredPrototypeType);
1470-
CopyDeferParseField(undeferredFunctionType);
14711474

14721475
other->SetFunctionObjectTypeList(this->GetFunctionObjectTypeList());
14731476

0 commit comments

Comments
 (0)