diff options
author | Bram Moolenaar <Bram@vim.org> | 2019-02-10 22:14:27 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2019-02-10 22:14:27 +0100 |
commit | 31b816042fca879b11965ddd75287732563ba698 (patch) | |
tree | 44495d2a1b5b7167e29b87be6bb96ad6e71549e4 /src/userfunc.c | |
parent | 9474716d39764ac5642e55b5548580cf53bd9bed (diff) | |
download | vim-git-31b816042fca879b11965ddd75287732563ba698.tar.gz |
patch 8.1.0888: the a: dict is not immutable as documentedv8.1.0888
Problem: The a: dict is not immutable as documented.
Solution: Make the a:dict immutable, add a test. (Ozaki Kiichi, Yasuhiro
Matsumoto, closes #3929)
Diffstat (limited to 'src/userfunc.c')
-rw-r--r-- | src/userfunc.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/userfunc.c b/src/userfunc.c index acbab901f..d1ea33afe 100644 --- a/src/userfunc.c +++ b/src/userfunc.c @@ -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; |