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)
diff --git a/src/userfunc.c b/src/userfunc.c
index d1ea33a..a293dd6 100644
--- a/src/userfunc.c
+++ b/src/userfunc.c
@@ -2394,11 +2394,11 @@
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