From acbfcd730209d2090c2e6d3aa350906cc1bd6382 Mon Sep 17 00:00:00 2001 From: dzaima Date: Mon, 10 Jul 2023 22:54:34 +0300 Subject: [PATCH] =?UTF-8?q?fix=20another=20weird=20case=20of=20?= =?UTF-8?q?=F0=9D=95=A8=E2=88=BE=F0=9D=95=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/builtins/sfns.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/builtins/sfns.c b/src/builtins/sfns.c index 76e0470b..a3835aef 100644 --- a/src/builtins/sfns.c +++ b/src/builtins/sfns.c @@ -933,10 +933,10 @@ B join_c2(B t, B w, B x) { ur rnk0 = RNK(r); ShArr* sh0 = shObj(r); usz* wsh; - if (wr==1 && usedW) { + if (wr<=1) { wsh = &wia0; } else { - wsh = SH(w); // when wr>1, shape object won't be disturbed by arr_join_inline + wsh = usedW? sh0->a : SH(w); // if usedW, arr_join_inline guarantees returning an array with shape of w if wr>1; otherwise, can just use w } usz* xsh = SH(x); SRNK(r, 0); // otherwise shape allocation failing may break things; leaves shape owned only here