diff src/userfunc.c @ 15780:5b6c3c7feba8 v8.1.0897

patch 8.1.0897: can modify a:000 when using a reference commit https://github.com/vim/vim/commit/05c00c038bc16e862e17f9e5c8d5a72af6cf7788 Author: Bram Moolenaar <Bram@vim.org> Date: Mon Feb 11 22:00:11 2019 +0100 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)
author Bram Moolenaar <Bram@vim.org>
date Mon, 11 Feb 2019 22:15:07 +0100
parents dff66c4670b1
children bd75c9df2a14
line wrap: on
line diff
--- a/src/userfunc.c
+++ b/src/userfunc.c
@@ -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