diff src/vim9compile.c @ 20972:d561e3c6cd65 v8.2.1037

patch 8.2.1037: Vim9: crash when using line continuation inside :def Commit: https://github.com/vim/vim/commit/acd4c5e914f8a06745624ba585f3d06d5faf4ddd Author: Bram Moolenaar <Bram@vim.org> Date: Mon Jun 22 19:39:03 2020 +0200 patch 8.2.1037: Vim9: crash when using line continuation inside :def Problem: Vim9: crash when using line continuation inside :def. Solution: Check for no more lines available.
author Bram Moolenaar <Bram@vim.org>
date Mon, 22 Jun 2020 19:45:03 +0200
parents 0ee7de260208
children bb49b5090a9c
line wrap: on
line diff
--- a/src/vim9compile.c
+++ b/src/vim9compile.c
@@ -2402,8 +2402,11 @@ peek_next_line(cctx_T *cctx)
     while (++lnum < cctx->ctx_ufunc->uf_lines.ga_len)
     {
 	char_u *line = ((char_u **)cctx->ctx_ufunc->uf_lines.ga_data)[lnum];
-	char_u *p = skipwhite(line);
-
+	char_u *p;
+
+	if (line == NULL)
+	    break;
+	p = skipwhite(line);
 	if (*p != NUL && !comment_start(p))
 	    return p;
     }