0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

patch 8.2.1491: Vim9: crash when compiling heredoc lines start with comment

Problem:    Vim9: crash when compiling heredoc lines start with comment.
Solution:   Skip over NULL pointers. Do not remove comment and empty lines
            when fetching function lines. (closes #6743)
This commit is contained in:
Bram Moolenaar
2020-08-20 15:02:42 +02:00
parent 93ad14710b
commit 66250c932e
16 changed files with 81 additions and 45 deletions

View File

@@ -1761,6 +1761,13 @@ typedef struct
# endif
} scriptitem_T;
// type of getline() last argument
typedef enum {
GETLINE_NONE, // do not concatenate any lines
GETLINE_CONCAT_CONT, // concatenate continuation lines
GETLINE_CONCAT_ALL // concatenate continuation and Vim9 # comment lines
} getline_opt_T;
// Struct passed through eval() functions.
// See EVALARG_EVALUATE for a fixed value with eval_flags set to EVAL_EVALUATE.
typedef struct {
@@ -1768,7 +1775,7 @@ typedef struct {
int eval_break_count; // nr of line breaks consumed
// copied from exarg_T when "getline" is "getsourceline". Can be NULL.
char_u *(*eval_getline)(int, void *, int, int);
char_u *(*eval_getline)(int, void *, int, getline_opt_T);
void *eval_cookie; // argument for eval_getline()
// used when compiling a :def function, NULL otherwise