Skip to content

Commit a653bc9

Browse files
committed
Fix assert when building newly rooted path type
1 parent 366d49c commit a653bc9

File tree

3 files changed

+381
-359
lines changed

3 files changed

+381
-359
lines changed

lib/Runtime/Types/PathTypeHandler.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2695,7 +2695,12 @@ namespace Js
26952695
newTypeHandler = PathTypeHandlerBase::FromTypeHandler(type->GetTypeHandler());
26962696
if (attr == ObjectSlotAttr_Setter)
26972697
{
2698-
newTypeHandler->SetSetterSlot(newTypeHandler->GetTypePath()->LookupInline(propertyId, newTypeHandler->GetPathLength()), (PathTypeSetterSlotIndex)(newTypeHandler->GetPathLength() - 1));
2698+
PropertyIndex getterIndex = newTypeHandler->GetTypePath()->LookupInline(propertyId, newTypeHandler->GetPathLength());
2699+
Assert(getterIndex != Constants::NoSlot);
2700+
if (attributes[getterIndex] & ObjectSlotAttr_Accessor)
2701+
{
2702+
newTypeHandler->SetSetterSlot(getterIndex, (PathTypeSetterSlotIndex)(newTypeHandler->GetPathLength() - 1));
2703+
}
26992704
}
27002705
}
27012706
Assert(newTypeHandler->GetPathLength() == GetPathLength());

test/es5/objlitgetset3.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
var v_8184 = {
2+
d: "vEH1gs5LChZC6hiytm4BhQY6D1BvBbSR",
3+
set d(x) { this.d = x + 0x1337; },
4+
f: undefined,
5+
d: -0,
6+
m: 794.4080805517691,
7+
get a() { return 1337; }
8+
};
9+
10+
v_8184.__proto__ = {};
11+
if (v_8184.d === -0)
12+
WScript.Echo('pass');

0 commit comments

Comments
 (0)