diff src/eval.c @ 28273:fff70771d4bb v8.2.4662

patch 8.2.4662: no error for using out of range list index Commit: https://github.com/vim/vim/commit/22ebd172e48ba060c8a7bae3dbf6480b7596d937 Author: Bram Moolenaar <Bram@vim.org> Date: Fri Apr 1 15:26:58 2022 +0100 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)
author Bram Moolenaar <Bram@vim.org>
date Fri, 01 Apr 2022 16:30:03 +0200
parents c446812efd60
children b418e073b42f
line wrap: on
line diff
--- a/src/eval.c
+++ b/src/eval.c
@@ -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);