Skip to content

Commit

Permalink
[MERGE #4528 @leirocks] Fix bad assertion in DirectSetItemAtRange for…
Browse files Browse the repository at this point in the history
… OP_MEMSET

Merge pull request #4528 from leirocks:op_memset
  • Loading branch information
leirocks committed Jan 16, 2018
2 parents b0a2395 + c23dae7 commit a0d01ee
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions lib/Runtime/Library/JavascriptArray.inl
Original file line number Diff line number Diff line change
Expand Up @@ -1160,23 +1160,15 @@ SECOND_PASS:
}
else if (startIndex == 0 && length > this->length && (head == EmptySegment || length > head->size))
{

Recycler *recycler = GetRecycler();
this->length = length;
this->EnsureHead<T>();
SparseArraySegmentBase* current = nullptr;

Assert(head->size < length);

current = SparseArraySegment<T>::AllocateSegment(recycler, 0, length, (SparseArraySegment<T> *)nullptr);
SparseArraySegmentBase* current = SparseArraySegment<T>::AllocateSegment(recycler, 0, length, (SparseArraySegment<T> *)nullptr);
this->SetHeadAndLastUsedSegment(current);
this->length = length;

Assert(!HasSegmentMap());

SetHasNoMissingValues(true);

CopyValueToSegmentBuferNoCheck(((Js::SparseArraySegment<T>*)current)->elements, length, newValue);
this->SetLastUsedSegment(current);
}
else
{
Expand Down

0 comments on commit a0d01ee

Please sign in to comment.