0
0
mirror of https://github.com/vim/vim.git synced 2025-07-26 11:04:33 -04:00

patch 8.2.2313: Vim9: using uninitialized field when parsing range

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)
This commit is contained in:
Bram Moolenaar 2021-01-08 20:40:45 +01:00
parent 467b59c2eb
commit ece0b87c0f
3 changed files with 11 additions and 1 deletions

View File

@ -661,6 +661,12 @@ def Test_range_after_command_modifier()
bwipe!
enddef
def Test_silent_pattern()
new
silent! :/pat/put _
bwipe!
enddef
def Test_eval_command()
var from = 3
var to = 5

View File

@ -750,6 +750,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
2313,
/**/
2312,
/**/

View File

@ -3148,11 +3148,13 @@ call_def_function(
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 failed;
goto on_error;
if (ea.addr_count == 0)
tv->vval.v_number = curwin->w_cursor.lnum;
else