From 591344ca9df24feadc10db8cd8a6e37252cdbaf9 Mon Sep 17 00:00:00 2001 From: rick2600 Date: Tue, 5 Oct 2021 01:45:59 -0300 Subject: [PATCH] fix issue #825 --- src/core/array.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/core/array.c b/src/core/array.c index 0c9810c7..36d82833 100644 --- a/src/core/array.c +++ b/src/core/array.c @@ -241,6 +241,11 @@ JANET_CORE_FN(cfun_array_concat, int32_t j, len = 0; const Janet *vals = NULL; janet_indexed_view(argv[i], &vals, &len); + if (array->data == vals) { + int32_t newcount = array->count + len; + janet_array_ensure(array, newcount, 2); + janet_indexed_view(argv[i], &vals, &len); + } for (j = 0; j < len; j++) janet_array_push(array, vals[j]); }