From 9bb7fa406bfde8a76325b520f7333534ae8a737a Mon Sep 17 00:00:00 2001 From: dzaima Date: Fri, 21 Apr 2023 15:50:42 +0300 Subject: [PATCH] add assertion for arr_shReplace rank expectation --- src/core/stuff.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/core/stuff.h b/src/core/stuff.h index 8c929527..62307411 100644 --- a/src/core/stuff.h +++ b/src/core/stuff.h @@ -102,7 +102,8 @@ static Arr* arr_shCopyUnchecked(Arr* n, B o) { } return n; } -static Arr* arr_shReplace(Arr* x, ur r, ShArr* sh) { // replace x's shape with a new one +static Arr* arr_shReplace(Arr* x, ur r, ShArr* sh) { // replace x's shape with a new one; assumes r>1, but PRNK(x) can be anything + assert(r>1); usz* prevsh = x->sh; u8 xr = PRNK(x); SPRNK(x, r);