From 94e61683196c6626e29cd04e2fb3a911036cf8e8 Mon Sep 17 00:00:00 2001 From: dzaima Date: Wed, 7 Sep 2022 19:41:15 +0300 Subject: [PATCH] don't read past the end of array even if the value isn't used bit_sel still uses it --- src/builtins/select.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/builtins/select.c b/src/builtins/select.c index 2397128e..b6edc28d 100644 --- a/src/builtins/select.c +++ b/src/builtins/select.c @@ -125,13 +125,18 @@ B select_c2(B t, B w, B x) { return taga(cpyBitArr(select_c2(m_f64(0), w, taga(cpyI8Arr(x))))); } if (we==el_bit) { + SGetU(x) + B x0 = GetU(x, 0); + B x1; if (xia<2) { u64* wp=bitarr_ptr(w); usz i; for (i=0; i