patch 8.2.4255: theoretical computation overflow
Problem: Theoretical computation overflow.
Solution: Perform multiplication in a wider type. (closes #9657)
diff --git a/src/evalfunc.c b/src/evalfunc.c
index 879fe22..cb5fcfe 100644
--- a/src/evalfunc.c
+++ b/src/evalfunc.c
@@ -7327,7 +7327,7 @@
if ((l->lv_u.nonmat.lv_stride > 0) ^ domax)
n = l->lv_u.nonmat.lv_start;
else
- n = l->lv_u.nonmat.lv_start + (l->lv_len - 1)
+ n = l->lv_u.nonmat.lv_start + ((varnumber_T)l->lv_len - 1)
* l->lv_u.nonmat.lv_stride;
}
else