1
0
forked from aniani/vim

patch 8.1.0888: the a: dict is not immutable as documented

Problem:    The a: dict is not immutable as documented.
Solution:   Make the a:dict immutable, add a test. (Ozaki Kiichi, Yasuhiro
            Matsumoto, closes #3929)
This commit is contained in:
Bram Moolenaar
2019-02-10 22:14:27 +01:00
parent 9474716d39
commit 31b816042f
5 changed files with 210 additions and 9 deletions

View File

@@ -772,7 +772,7 @@ call_user_func(
v = &fc->fixvar[fixvar_idx++].var;
name = v->di_key;
STRCPY(name, "self");
v->di_flags = DI_FLAGS_RO + DI_FLAGS_FIX;
v->di_flags = DI_FLAGS_RO | DI_FLAGS_FIX;
hash_add(&fc->l_vars.dv_hashtab, DI2HIKEY(v));
v->di_tv.v_type = VAR_DICT;
v->di_tv.v_lock = 0;
@@ -788,6 +788,7 @@ call_user_func(
init_var_dict(&fc->l_avars, &fc->l_avars_var, VAR_SCOPE);
add_nr_var(&fc->l_avars, &fc->fixvar[fixvar_idx++].var, "0",
(varnumber_T)(argcount - fp->uf_args.ga_len));
fc->l_avars.dv_lock = VAR_FIXED;
/* Use "name" to avoid a warning from some compiler that checks the
* destination size. */
v = &fc->fixvar[fixvar_idx++].var;