mirror of
https://github.com/neovim/neovim.git
synced 2025-09-16 08:18:17 +00:00
vim-patch:8.1.0897: can modify a:000 when using a reference (#14902)
Problem: Can modify a:000 when using a reference.
Solution: Make check for locked variable stricter. (Ozaki Kiichi,
closes vim/vim#3930)
05c00c038b
This commit is contained in:
@@ -2455,13 +2455,13 @@ void ex_function(exarg_T *eap)
|
||||
goto erret;
|
||||
}
|
||||
if (fudi.fd_di == NULL) {
|
||||
if (tv_check_lock(fudi.fd_dict->dv_lock, (const char *)eap->arg,
|
||||
TV_CSTRING)) {
|
||||
if (var_check_lock(fudi.fd_dict->dv_lock, (const char *)eap->arg,
|
||||
TV_CSTRING)) {
|
||||
// Can't add a function to a locked dictionary
|
||||
goto erret;
|
||||
}
|
||||
} else if (tv_check_lock(fudi.fd_di->di_tv.v_lock, (const char *)eap->arg,
|
||||
TV_CSTRING)) {
|
||||
} else if (var_check_lock(fudi.fd_di->di_tv.v_lock, (const char *)eap->arg,
|
||||
TV_CSTRING)) {
|
||||
// Can't change an existing function if it is locked
|
||||
goto erret;
|
||||
}
|
||||
|
Reference in New Issue
Block a user