Skip to content

Commit 815b22b

Browse files
committed
remove invalid assert inside CachePropertyReadForGetter
1 parent 22e34d8 commit 815b22b

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

lib/Runtime/Language/CacheOperators.cpp

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -108,12 +108,12 @@ namespace Js
108108
PropertyId propertyId,
109109
ScriptContext* requestContext)
110110
{
111-
if (!info || !CacheOperators::CanCachePropertyRead(info, info->GetInstance(), requestContext))
111+
RecyclableObject* originalObj = JavascriptOperators::TryFromVar<RecyclableObject>(originalInstance);
112+
if (!info || !originalObj || !CacheOperators::CanCachePropertyRead(info, info->GetInstance(), requestContext))
112113
{
113114
return;
114115
}
115116

116-
Assert(RecyclableObject::Is(originalInstance));
117117
Assert(DynamicType::Is(info->GetInstance()->GetTypeId()));
118118

119119
DynamicObject * dynamicInstance = DynamicObject::FromVar(info->GetInstance());
@@ -122,11 +122,7 @@ namespace Js
122122
dynamicInstance->GetDynamicType()->GetTypeHandler()->PropertyIndexToInlineOrAuxSlotIndex(info->GetPropertyIndex(), &slotIndex, &isInlineSlot);
123123

124124
const bool isProto = info->GetInstance() != originalInstance;
125-
if(isProto &&
126-
(
127-
!RecyclableObject::Is(originalInstance) ||
128-
RecyclableObject::FromVar(originalInstance)->GetScriptContext() != requestContext
129-
))
125+
if (isProto && originalObj->GetScriptContext() != requestContext)
130126
{
131127
// Don't need to cache if the beginning property is number etc.
132128
return;
@@ -147,7 +143,7 @@ namespace Js
147143
isProto,
148144
dynamicInstance,
149145
false,
150-
RecyclableObject::FromVar(originalInstance)->GetType(),
146+
originalObj->GetType(),
151147
nullptr,
152148
propertyId,
153149
slotIndex,

0 commit comments

Comments
 (0)