From 36a27b84243563ec2a7aa7683f9ffc34ab7279a8 Mon Sep 17 00:00:00 2001 From: dzaima Date: Mon, 31 May 2021 21:34:47 +0300 Subject: [PATCH] fix rank>1 empty array args for f64_maybe_i32 --- src/builtins/arithd.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/builtins/arithd.c b/src/builtins/arithd.c index a156f1eb..b768f2b8 100644 --- a/src/builtins/arithd.c +++ b/src/builtins/arithd.c @@ -7,7 +7,10 @@ static B f64_maybe_i32(B x) { f64* xp = f64arr_ptr(x); usz ia = a(x)->ia; - if (ia==0) { dec(x); return inc(bi_emptyIVec); } + if (ia==0) { + if (rnk(x)>1) return x; + dec(x); return inc(bi_emptyIVec); + } if (xp[0] != (i32)xp[0]) return x; i32* rp; B r = m_i32arrc(&rp, x); for (usz i = 0; i < ia; i++) {