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:
@@ -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
|
||||
|
Reference in New Issue
Block a user