Skip to content

Commit bdd48f2

Browse files
Chakra Automationpleath
authored andcommitted
1 parent a0e8946 commit bdd48f2

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

lib/Runtime/Types/DeferredTypeHandler.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ namespace Js
3131
{
3232
undeferredFunctionType = functionProxy->GetUndeferredFunctionType();
3333
}
34-
if (undeferredFunctionType && !isProto && !instance->IsCrossSiteObject())
34+
if (undeferredFunctionType && !isProto && !instance->IsCrossSiteObject() && (undeferredFunctionType->GetPrototype() == instance->GetType()->GetPrototype()))
3535
{
3636
Assert(undeferredFunctionType->GetIsShared());
3737
Assert(!CrossSite::IsThunk(undeferredFunctionType->GetEntryPoint()));
@@ -40,9 +40,8 @@ namespace Js
4040
else
4141
{
4242
typeHandler->SetInstanceTypeHandler(instance);
43-
if (functionProxy && !isProto && typeHandler->GetMayBecomeShared() && !CrossSite::IsThunk(instance->GetType()->GetEntryPoint()) && !PHASE_OFF1(ShareFuncTypesPhase))
43+
if (functionProxy && !isProto && typeHandler->GetMayBecomeShared() && !CrossSite::IsThunk(instance->GetType()->GetEntryPoint()) && !functionProxy->GetUndeferredFunctionType() && !PHASE_OFF1(ShareFuncTypesPhase))
4444
{
45-
Assert(!functionProxy->GetUndeferredFunctionType());
4645
functionProxy->SetUndeferredFunctionType(ScriptFunction::UnsafeFromVar(instance)->GetScriptFunctionType());
4746
instance->ShareType();
4847
}

0 commit comments

Comments
 (0)