diff src/vim9execute.c @ 19449:f8408ba21982 v8.2.0282

patch 8.2.0282: Vim9: setting number option not tested Commit: https://github.com/vim/vim/commit/401d9ffb5a8a40102c000c2d2614aa043f541f90 Author: Bram Moolenaar <Bram@vim.org> Date: Wed Feb 19 18:14:44 2020 +0100 patch 8.2.0282: Vim9: setting number option not tested Problem: Vim9: setting number option not tested. Solution: Add more tests. Fix assigning to global variable.
author Bram Moolenaar <Bram@vim.org>
date Wed, 19 Feb 2020 18:15:05 +0100
parents 6e27e1ffa2a6
children 655631882288
line wrap: on
line diff
--- a/src/vim9execute.c
+++ b/src/vim9execute.c
@@ -726,8 +726,10 @@ call_def_function(
 		    int	reg = iptr->isn_arg.number;
 
 		    --ectx.ec_stack.ga_len;
+		    tv = STACK_TV_BOT(0);
 		    write_reg_contents(reg == '@' ? '"' : reg,
-				    tv_get_string(STACK_TV_BOT(0)), -1, FALSE);
+						 tv_get_string(tv), -1, FALSE);
+		    clear_tv(tv);
 		}
 		break;
 
@@ -746,7 +748,7 @@ call_def_function(
 
 		    --ectx.ec_stack.ga_len;
 		    di = find_var_in_ht(get_globvar_ht(), 0,
-						   iptr->isn_arg.string, TRUE);
+					       iptr->isn_arg.string + 2, TRUE);
 		    if (di == NULL)
 		    {
 			funccal_entry_T entry;