summaryrefslogtreecommitdiffstats
path: root/src/eval.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2021-06-01 21:21:55 +0200
committerBram Moolenaar <Bram@vim.org>2021-06-01 21:21:55 +0200
commit6f1d2aa437744a7cb0206fdaa543a788c5a56c79 (patch)
tree69fa87e33af45f6763679098bda0011e83041e19 /src/eval.c
parent6a43b37b760347b9a1bedf12e41b458000922969 (diff)
patch 8.2.2920: still a way to shadow a builtin functionv8.2.2920
Problem: Still a way to shadow a builtin function. (Yasuhiro Matsumoto) Solution: Check the key when using extend(). (issue #8302)
Diffstat (limited to 'src/eval.c')
-rw-r--r--src/eval.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/eval.c b/src/eval.c
index 9fb3b4e2ca..7a05d359ba 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -1462,12 +1462,8 @@ set_var_lval(
semsg(_(e_dictkey), lp->ll_newkey);
return;
}
- if ((lp->ll_tv->vval.v_dict == get_globvar_dict()
- || lp->ll_tv->vval.v_dict ==
- &SCRIPT_ITEM(current_sctx.sc_sid)->sn_vars->sv_dict)
- && (rettv->v_type == VAR_FUNC
- || rettv->v_type == VAR_PARTIAL)
- && var_wrong_func_name(lp->ll_newkey, TRUE))
+ if (dict_wrong_func_name(lp->ll_tv->vval.v_dict, rettv,
+ lp->ll_newkey))
return;
// Need to add an item to the Dictionary.