@@ -2563,8 +2563,9 @@ namespace Js
2563
2563
Assert (IsObjectHeaderInlinedTypeHandler ());
2564
2564
2565
2565
// Clone the type Path here to evolve separately
2566
+ Recycler * recycler = library->GetRecycler ();
2566
2567
uint16 pathLength = GetPathLength ();
2567
- TypePath * clonedPath = TypePath::New (library-> GetRecycler () , pathLength);
2568
+ TypePath * clonedPath = TypePath::New (recycler , pathLength);
2568
2569
2569
2570
ObjectSlotAttributes *attributes = this ->GetAttributeArray ();
2570
2571
for (PropertyIndex i = 0 ; i < pathLength; i++)
@@ -2597,12 +2598,29 @@ namespace Js
2597
2598
}
2598
2599
else
2599
2600
{
2601
+ uint8 newTypePathSize = clonedPath->GetPathSize ();
2602
+
2603
+ ObjectSlotAttributes * newAttributes = RecyclerNewArrayLeaf (recycler, ObjectSlotAttributes, newTypePathSize);
2604
+ memcpy (newAttributes, attributes, sizeof (ObjectSlotAttributes) * newTypePathSize);
2605
+
2606
+ PathTypeSetterSlotIndex * setters = GetSetterSlots ();
2607
+ PathTypeSetterSlotIndex * newSetters;
2608
+ if (setters == nullptr )
2609
+ {
2610
+ newSetters = nullptr ;
2611
+ }
2612
+ else
2613
+ {
2614
+ newSetters = RecyclerNewArrayLeaf (recycler, PathTypeSetterSlotIndex, newTypePathSize);
2615
+ memcpy (newSetters, setters, sizeof (PathTypeSetterSlotIndex) * newTypePathSize);
2616
+ }
2617
+
2600
2618
clonedTypeHandler =
2601
2619
PathTypeHandlerWithAttr::New (
2602
2620
library->GetScriptContext (),
2603
2621
clonedPath,
2604
- attributes ,
2605
- GetSetterSlots () ,
2622
+ newAttributes ,
2623
+ newSetters ,
2606
2624
GetSetterCount (),
2607
2625
GetPathLength (),
2608
2626
static_cast <PropertyIndex>(GetSlotCapacity ()),
0 commit comments