Patch 8.2.2313
Problem: Vim9: using uninitialized field when parsing range. ":silent!" not
respected when parsing range fails.
Solution: Initialize ea.skip. On pattern failure handle it like an error.
(closes #7636)
Files: src/vim9execute.c, src/testdir/test_vim9_cmd.vim
*** ../vim-8.2.2312/src/vim9execute.c 2021-01-06 21:59:35.174021934 +0100
--- src/vim9execute.c 2021-01-08 20:38:06.538512003 +0100
***************
*** 3148,3158 ****
goto failed;
++ectx.ec_stack.ga_len;
tv = STACK_TV_BOT(-1);
ea.addr_count = 0;
ea.addr_type = ADDR_LINES;
ea.cmd = iptr->isn_arg.string;
if (parse_cmd_address(&ea, &errormsg, FALSE) == FAIL)
! goto failed;
if (ea.addr_count == 0)
tv->vval.v_number = curwin->w_cursor.lnum;
else
--- 3148,3160 ----
goto failed;
++ectx.ec_stack.ga_len;
tv = STACK_TV_BOT(-1);
+ ea.line2 = 0;
ea.addr_count = 0;
ea.addr_type = ADDR_LINES;
ea.cmd = iptr->isn_arg.string;
+ ea.skip = FALSE;
if (parse_cmd_address(&ea, &errormsg, FALSE) == FAIL)
! goto on_error;
if (ea.addr_count == 0)
tv->vval.v_number = curwin->w_cursor.lnum;
else
*** ../vim-8.2.2312/src/testdir/test_vim9_cmd.vim 2021-01-05
19:23:25.088642148 +0100
--- src/testdir/test_vim9_cmd.vim 2021-01-08 20:35:04.310903752 +0100
***************
*** 661,666 ****
--- 661,672 ----
bwipe!
enddef
+ def Test_silent_pattern()
+ new
+ silent! :/pat/put _
+ bwipe!
+ enddef
+
def Test_eval_command()
var from = 3
var to = 5
*** ../vim-8.2.2312/src/version.c 2021-01-08 19:31:35.956060245 +0100
--- src/version.c 2021-01-08 19:49:40.396831113 +0100
***************
*** 752,753 ****
--- 752,755 ----
{ /* Add new patch number below this line */
+ /**/
+ 2313,
/**/
--
Corduroy pillows: They're making headlines!
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ 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/202101081941.108Jf9U1948483%40masaka.moolenaar.net.