Skip to content

Commit

Permalink
[1.8>1.9] [MERGE #4528 @leirocks] Fix bad assertion in DirectSetItemA…
Browse files Browse the repository at this point in the history
…tRange for OP_MEMSET

Merge pull request #4528 from leirocks:op_memset
  • Loading branch information
leirocks committed Jan 16, 2018
2 parents c6ae741 + a0d01ee commit 79ef8ed
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 79ef8ed

Please sign in to comment.