summaryrefslogtreecommitdiff
path: root/src/eval.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-02-10 22:14:27 +0100
committerBram Moolenaar <Bram@vim.org>2019-02-10 22:14:27 +0100
commit31b816042fca879b11965ddd75287732563ba698 (patch)
tree44495d2a1b5b7167e29b87be6bb96ad6e71549e4 /src/eval.c
parent9474716d39764ac5642e55b5548580cf53bd9bed (diff)
downloadvim-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/eval.c')
-rw-r--r--src/eval.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/eval.c b/src/eval.c
index 3f9db7d16..08603cad6 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -2092,14 +2092,15 @@ get_lval(
if (lp->ll_di == NULL)
{
- /* Can't add "v:" variable. */
- if (lp->ll_dict == &vimvardict)
+ // Can't add "v:" or "a:" variable.
+ if (lp->ll_dict == &vimvardict
+ || &lp->ll_dict->dv_hashtab == get_funccal_args_ht())
{
semsg(_(e_illvar), name);
return NULL;
}
- /* Key does not exist in dict: may need to add it. */
+ // Key does not exist in dict: may need to add it.
if (*p == '[' || *p == '.' || unlet)
{
if (!quiet)
@@ -7919,14 +7920,14 @@ set_var(
}
else /* add a new variable */
{
- /* Can't add "v:" variable. */
- if (ht == &vimvarht)
+ // Can't add "v:" or "a:" variable.
+ if (ht == &vimvarht || ht == get_funccal_args_ht())
{
semsg(_(e_illvar), name);
return;
}
- /* Make sure the variable name is valid. */
+ // Make sure the variable name is valid.
if (!valid_varname(varname))
return;