From 66584ce1491d300746963b8ed17170348b2a03e6 Mon Sep 17 00:00:00 2001 From: dzaima Date: Fri, 21 Oct 2022 18:17:12 +0300 Subject: [PATCH] =?UTF-8?q?fix=200=E2=80=BF=C2=AF1=E2=8A=8F129=E2=A5=8A100?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/builtins/select.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/builtins/select.c b/src/builtins/select.c index 13e6b72e..a5d686c2 100644 --- a/src/builtins/select.c +++ b/src/builtins/select.c @@ -73,9 +73,9 @@ B select_c2(B t, B w, B x) { // if (we==el_i32 && xe==el_i32) { i32* rp; r = m_i32arrc(&rp, w); if (!avx2_select_i32_32((u8*)i32any_ptr(w), (u8*)i32any_ptr(x), (u8*)rp, wia, xia)) thrM("โŠ: Indexing out-of-bounds"); goto dec_ret; } // if (we==el_i32 && xe==el_f64) { f64* rp; r = m_f64arrc(&rp, w); if (!avx2_select_i32_64((u8*)i32any_ptr(w), (u8*)f64any_ptr(x), (u8*)rp, wia, xia)) thrM("โŠ: Indexing out-of-bounds"); goto dec_ret; } #endif - #define CASE(S,E) case S: for (usz i=i0; i=(i64)xia) thrF("โŠ: Indexing out-of-bounds (%iโˆŠ๐•จ, %sโ‰กโ‰ ๐•ฉ)", max, xia); \ W* ip=wp; usz off=xia; \ if (max>=0) { off=0; if (RARE(min<0)) { \ + if (RARE(xia > (1ULL<<(sizeof(W)*8-1)))) { w=taga(NEXT(w)); mm_free(v(r)); return select_c2(m_f64(0), w, x); } \ if (!wt) {wt=TALLOCP(W,i1-i0);} ip=wt-i0; \ for (usz i=i0; i