Mercurial > vim
comparison 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 |
comparison
equal
deleted
inserted
replaced
20971:d906d18f4ffb | 20972:d561e3c6cd65 |
---|---|
2400 int lnum = cctx->ctx_lnum; | 2400 int lnum = cctx->ctx_lnum; |
2401 | 2401 |
2402 while (++lnum < cctx->ctx_ufunc->uf_lines.ga_len) | 2402 while (++lnum < cctx->ctx_ufunc->uf_lines.ga_len) |
2403 { | 2403 { |
2404 char_u *line = ((char_u **)cctx->ctx_ufunc->uf_lines.ga_data)[lnum]; | 2404 char_u *line = ((char_u **)cctx->ctx_ufunc->uf_lines.ga_data)[lnum]; |
2405 char_u *p = skipwhite(line); | 2405 char_u *p; |
2406 | 2406 |
2407 if (line == NULL) | |
2408 break; | |
2409 p = skipwhite(line); | |
2407 if (*p != NUL && !comment_start(p)) | 2410 if (*p != NUL && !comment_start(p)) |
2408 return p; | 2411 return p; |
2409 } | 2412 } |
2410 return NULL; | 2413 return NULL; |
2411 } | 2414 } |