1
0
forked from aniani/vim

patch 8.2.4255: theoretical computation overflow

Problem:    Theoretical computation overflow.
Solution:   Perform multiplication in a wider type. (closes #9657)
This commit is contained in:
=?UTF-8?q?Dundar=20G=C3=B6c?=
2022-01-29 15:19:23 +00:00
committed by Bram Moolenaar
parent f12b7815f6
commit d5cec1f1f0
11 changed files with 28 additions and 23 deletions

View File

@@ -7327,7 +7327,7 @@ max_min(typval_T *argvars, typval_T *rettv, int domax)
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