diff src/evalvars.c @ 19201:e7b4fff348dd v8.2.0159

patch 8.2.0159: non-materialized range() list causes problems Commit: https://github.com/vim/vim/commit/50985eb1f0bd3c73ce727f9bbd66c839c92ef0da Author: Bram Moolenaar <Bram@vim.org> Date: Mon Jan 27 22:09:39 2020 +0100 patch 8.2.0159: non-materialized range() list causes problems Problem: Non-materialized range() list causes problems. (Fujiwara Takuya) Solution: Materialize the list where needed.
author Bram Moolenaar <Bram@vim.org>
date Mon, 27 Jan 2020 22:15:07 +0100
parents 2ef19eed524a
children d776967d0f0d
line wrap: on
line diff
--- a/src/evalvars.c
+++ b/src/evalvars.c
@@ -843,6 +843,7 @@ ex_let_vars(
 	return FAIL;
     }
 
+    range_list_materialize(l);
     item = l->lv_first;
     while (*arg != ']')
     {
@@ -1699,7 +1700,7 @@ item_lock(typval_T *tv, int deep, int lo
 		    l->lv_lock |= VAR_LOCKED;
 		else
 		    l->lv_lock &= ~VAR_LOCKED;
-		if (deep < 0 || deep > 1)
+		if ((deep < 0 || deep > 1) && l->lv_first != &range_list_item)
 		    // recursive: lock/unlock the items the List contains
 		    for (li = l->lv_first; li != NULL; li = li->li_next)
 			item_lock(&li->li_tv, deep - 1, lock);