Add an early return to array_copy()

This fixes test_array_copy() broken by 0274052.
This commit is contained in:
kichikuou
2021-05-01 19:49:33 +09:00
parent 0274052947
commit eda0fc244f
+2
View File
@@ -369,6 +369,8 @@ static bool array_index_ok(struct page *array, int i)
void array_copy(struct page *dst, int dst_i, struct page *src, int src_i, int n)
{
if (n <= 0)
return;
if (!dst || !src)
ERROR("Array is NULL");
if (dst->type != ARRAY_PAGE || src->type != ARRAY_PAGE)