0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -04:00

patch 8.2.4662: no error for using out of range list index

Problem:    No error for using out of range list index.
Solution:   Check list index at script level like in compiled function.
            (closes #10051)
This commit is contained in:
Bram Moolenaar
2022-04-01 15:26:58 +01:00
parent ffe6e646dc
commit 22ebd172e4
8 changed files with 26 additions and 11 deletions

View File

@@ -1311,7 +1311,8 @@ get_lval(
lp->ll_dict = NULL;
lp->ll_list = lp->ll_tv->vval.v_list;
lp->ll_li = check_range_index_one(lp->ll_list, &lp->ll_n1, quiet);
lp->ll_li = check_range_index_one(lp->ll_list, &lp->ll_n1,
(flags & GLV_ASSIGN_WITH_OP) == 0, quiet);
if (lp->ll_li == NULL)
{
clear_tv(&var2);