From b46477450d20fbd2ded7d0fb149e4c674c1c2bc4 Mon Sep 17 00:00:00 2001 From: dzaima Date: Thu, 18 May 2023 16:31:39 +0300 Subject: [PATCH] =?UTF-8?q?fix=20shape=20of=20argument=20passed=20to=20F?= =?UTF-8?q?=20in=20F=E2=8C=BE(is=E2=8A=B8=E2=8A=91)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit & skip computing the argument if not needed --- src/builtins/sfns.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/builtins/sfns.c b/src/builtins/sfns.c index 50d334f1..db824413 100644 --- a/src/builtins/sfns.c +++ b/src/builtins/sfns.c @@ -1313,22 +1313,21 @@ B pick_ucw(B t, B o, B w, B x) { if (RARE(RNK(x)!=1)) goto def; pos = WRAP(o2i64(w), xia, thrF("π”½βŒΎ(nβŠΈβŠ‘)𝕩: reading out-of-bounds (n≑%R, %s≑≠𝕩)", w, xia)); } else { - usz wia = IA(w); - usz* xsh = SH(x); ur xr = RNK(x); - if (xr==0) goto def; + if (RARE(xr==0)) goto def; + usz* xsh = SH(x); pos = pick_oneIndex(w, xr, xsh); if (pos == USZ_MAX) { + usz wia = IA(w); MAKE_MUT_INIT(r, wia, xia