0
0
mirror of https://github.com/vim/vim.git synced 2025-09-26 04:04:07 -04:00

patch 8.1.0897: can modify a:000 when using a reference

Problem:    Can modify a:000 when using a reference.
Solution:   Make check for locked variable stricter. (Ozaki Kiichi,
            closes #3930)
This commit is contained in:
Bram Moolenaar
2019-02-11 22:00:11 +01:00
parent 5a6698169d
commit 05c00c038b
8 changed files with 90 additions and 55 deletions

View File

@@ -2394,11 +2394,11 @@ ex_function(exarg_T *eap)
if (fudi.fd_di == NULL)
{
/* Can't add a function to a locked dictionary */
if (tv_check_lock(fudi.fd_dict->dv_lock, eap->arg, FALSE))
if (var_check_lock(fudi.fd_dict->dv_lock, eap->arg, FALSE))
goto erret;
}
/* Can't change an existing function if it is locked */
else if (tv_check_lock(fudi.fd_di->di_tv.v_lock, eap->arg, FALSE))
else if (var_check_lock(fudi.fd_di->di_tv.v_lock, eap->arg, FALSE))
goto erret;
/* Give the function a sequential number. Can only be used with a