1
0
forked from aniani/vim

patch 8.2.3116: Vim9: crash when debugging a function with line continuation

Problem:    Vim9: crash when debugging a function with line continuation.
Solution:   Check for a NULL pointer. (closes #8521)
This commit is contained in:
Bram Moolenaar
2021-07-07 20:10:43 +02:00
parent b5098060f4
commit 303215d60c
3 changed files with 19 additions and 2 deletions

View File

@@ -1497,9 +1497,11 @@ handle_debug(isn_T *iptr, ectx_T *ectx)
ga_init2(&ga, sizeof(char_u *), 10);
for (lnum = iptr->isn_lnum; lnum < end_lnum; ++lnum)
{
char_u *p = skipwhite(
((char_u **)ufunc->uf_lines.ga_data)[lnum - 1]);
char_u *p = ((char_u **)ufunc->uf_lines.ga_data)[lnum - 1];
if (p == NULL)
continue; // left over from continuation line
p = skipwhite(p);
if (*p == '#')
break;
if (ga_grow(&ga, 1) == OK)