0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -04:00

patch 8.2.2920: still a way to shadow a builtin function

Problem:    Still a way to shadow a builtin function. (Yasuhiro Matsumoto)
Solution:   Check the key when using extend(). (issue #8302)
This commit is contained in:
Bram Moolenaar
2021-06-01 21:21:55 +02:00
parent 6a43b37b76
commit 6f1d2aa437
5 changed files with 28 additions and 6 deletions

View File

@@ -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.