From 989970f7fd9d437f8346bd915f03f3d332734f36 Mon Sep 17 00:00:00 2001 From: dzaima Date: Sun, 22 Sep 2024 01:42:26 +0300 Subject: [PATCH] =?UTF-8?q?fix=20=E2=88=BE2=E2=80=BF2=E2=A5=8A<0=E2=80=BF0?= =?UTF-8?q?=E2=A5=8A=E2=9F=A8=E2=9F=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/builtins/sfns.c | 84 ++++++++++++++++++++++++-------------------- test/cases/prims.bqn | 6 ++++ 2 files changed, 52 insertions(+), 38 deletions(-) diff --git a/src/builtins/sfns.c b/src/builtins/sfns.c index 281797c3..e47ccd36 100644 --- a/src/builtins/sfns.c +++ b/src/builtins/sfns.c @@ -882,52 +882,60 @@ B join_c1(B t, B x) { } st[a] = len; } - - // Move the data + + // Shapes known correct; move the data usz* csh = tr ? SH(x0) + r0-tr : NULL; // Trailing shape usz csz = shProd(csh, 0, tr); - MAKE_MUT(r, shProd(st, 0, xr)*csz); - // Element index and effective shape, updated progressively - usz *ei =tsh; for (usz i=0; i0) { + MAKE_MUT(r, ria); + // Element index and effective shape, updated progressively + usz *ei =tsh; for (usz i=0; i