From 5d687b1ac3794acd22967eaf838bd457c589fc58 Mon Sep 17 00:00:00 2001 From: dzaima Date: Sun, 1 May 2022 03:00:36 +0300 Subject: [PATCH] =?UTF-8?q?lazy=20impl=20of=20i8/i16=20arrays=20in=20?= =?UTF-8?q?=F0=9D=95=A8=20of=20=E2=8A=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/builtins/sfns.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/builtins/sfns.c b/src/builtins/sfns.c index 31262a59..fa6dbc55 100644 --- a/src/builtins/sfns.c +++ b/src/builtins/sfns.c @@ -950,8 +950,9 @@ B group_c2(B t, B w, B x) { usz wia = a(w)->ia; usz xia = a(x)->ia; if (wia-xia > 1) thrF("โŠ”: โ‰ ๐•จ must be either โ‰ ๐•ฉ or one bigger (%sโ‰กโ‰ ๐•จ, %sโ‰กโ‰ ๐•ฉ)", wia, xia); - - if (TI(w,elType)==el_i32) { + u8 we = TI(w,elType); + if (we<=el_i32) { + if (we!=el_i32) w = taga(cpyI32Arr(w)); i32* wp = i32any_ptr(w); i64 ria = wia==xia? 0 : wp[xia]; if (ria<-1) thrM("โŠ”: ๐•จ can't contain elements less than ยฏ1");