Use memmove() for potentially overlapping ranges.

This commit is contained in:
Nikolay Igotti
2016-11-22 13:10:25 +03:00
parent bb6da99feb
commit e131622ef7
+1 -1
View File
@@ -58,7 +58,7 @@ void Kotlin_Array_copyImpl(const ArrayHeader* array, KInt fromIndex,
ThrowArrayIndexOutOfBoundsException();
}
// TODO: refcounting!
memcpy(ArrayAddressOfElementAt(destination, toIndex),
memmove(ArrayAddressOfElementAt(destination, toIndex),
ArrayAddressOfElementAt(array, fromIndex), count * sizeof(KRef));
}