Skip to content

Commit

Permalink
Memory overlap fix proposal.
Browse files Browse the repository at this point in the history
  • Loading branch information
devnexen committed Mar 1, 2020
1 parent b36efa4 commit 8f0ac7c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Sources/AngelScript/addons/scriptarray.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -664,7 +664,7 @@ void CScriptArray::RemoveRange(asUINT start, asUINT count)
// Compact the elements
// As objects in arrays of objects are not stored inline, it is safe to use memmove here
// since we're just copying the pointers to objects and not the actual objects.
memcpy(buffer->data + start*elementSize, buffer->data + (start + count)*elementSize, (buffer->numElements - count)*elementSize);
memmove(buffer->data + start*elementSize, buffer->data + (start + count)*elementSize, (buffer->numElements - count)*elementSize);
buffer->numElements -= count;
}

Expand Down

0 comments on commit 8f0ac7c

Please sign in to comment.