0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -04:00

patch 8.2.4622: Vim9: crash with :execute and :finish

Problem:    Vim9: Crash with :execute and :finish. (Sergey Vlasov)
Solution:   Check for NULL. (closes #10011)
This commit is contained in:
Bram Moolenaar
2022-03-25 11:16:28 +00:00
parent 9dd42a6311
commit 43216611a5
3 changed files with 25 additions and 1 deletions

View File

@@ -2144,7 +2144,8 @@ getline_peek_skip_comments(evalarg_T *evalarg)
p = skipwhite(next);
if (*p != NUL && !vim9_comment_start(p))
return next;
(void)eval_next_line(evalarg);
if (eval_next_line(evalarg) == NULL)
break;
}
return NULL;
}
@@ -2199,6 +2200,9 @@ eval_next_line(evalarg_T *evalarg)
GETLINE_CONCAT_ALL);
else
line = next_line_from_context(evalarg->eval_cctx, TRUE);
if (line == NULL)
return NULL;
++evalarg->eval_break_count;
if (gap->ga_itemsize > 0 && ga_grow(gap, 1) == OK)
{