Patch 8.2.4643
Problem: Vim9: variable may be locked unintentionally.
Solution: Clear "v_lock". (closes #10036)
Files: src/vim9execute.c, src/testdir/test_vim9_builtin.vim
*** ../vim-8.2.4642/src/vim9execute.c 2022-03-28 15:22:31.486443735 +0100
--- src/vim9execute.c 2022-03-28 18:12:27.643526792 +0100
***************
*** 937,942 ****
--- 937,943 ----
tv = STACK_TV_BOT(-1);
tv->v_type = VAR_NUMBER;
tv->vval.v_number = 0;
+ tv->v_lock = 0;
return OK;
}
*** ../vim-8.2.4642/src/testdir/test_vim9_builtin.vim 2022-03-27
16:29:49.880153368 +0100
--- src/testdir/test_vim9_builtin.vim 2022-03-28 18:10:58.743413650 +0100
***************
*** 371,380 ****
--- 371,387 ----
assert_fails('bufname([])', 'E1220:')
enddef
+ let s:bufnr_res = 0
+
def Test_bufnr()
var buf = bufnr()
bufnr('%')->assert_equal(buf)
+ # check the lock is not taken over through the stack
+ const nr = 10
+ bufnr_res = bufnr()
+ bufnr_res = 12345
+
buf = bufnr('Xdummy', true)
buf->assert_notequal(-1)
exe 'bwipe! ' .. buf
*** ../vim-8.2.4642/src/version.c 2022-03-28 15:22:31.490443719 +0100
--- src/version.c 2022-03-28 18:05:11.863310512 +0100
***************
*** 752,753 ****
--- 752,755 ----
{ /* Add new patch number below this line */
+ /**/
+ 4643,
/**/
--
Trees moving back and forth is what makes the wind blow.
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vim_dev/20220328171725.1EF0E1C0C1F%40moolenaar.net.