diff --git a/src/testdir/test_vim9_builtin.vim b/src/testdir/test_vim9_builtin.vim index 24a7f9583e..01f29d9d2b 100644 --- a/src/testdir/test_vim9_builtin.vim +++ b/src/testdir/test_vim9_builtin.vim @@ -371,10 +371,17 @@ def Test_bufname() 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 diff --git a/src/version.c b/src/version.c index 9d3afeb165..fe7f299cbd 100644 --- a/src/version.c +++ b/src/version.c @@ -750,6 +750,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 4643, /**/ 4642, /**/ diff --git a/src/vim9execute.c b/src/vim9execute.c index a95a488068..c5dc30da04 100644 --- a/src/vim9execute.c +++ b/src/vim9execute.c @@ -937,6 +937,7 @@ call_prepare(int argcount, typval_T *argvars, ectx_T *ectx) tv = STACK_TV_BOT(-1); tv->v_type = VAR_NUMBER; tv->vval.v_number = 0; + tv->v_lock = 0; return OK; }