Skip to content

Commit

Permalink
patch 8.2.1162: crash when using a lambda
Browse files Browse the repository at this point in the history
Problem:    Crash when using a lambda.
Solution:   Check for evalarg to be NULL.
  • Loading branch information
brammool committed Jul 8, 2020
1 parent 8e2730a commit efaaaa6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/userfunc.c
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@ get_lambda_tv(char_u **arg, typval_T *rettv, evalarg_T *evalarg)
}

eval_lavars_used = old_eval_lavars;
if (evalarg->eval_tofree == NULL)
if (evalarg != NULL && evalarg->eval_tofree == NULL)
evalarg->eval_tofree = tofree;
else
vim_free(tofree);
Expand All @@ -519,7 +519,7 @@ get_lambda_tv(char_u **arg, typval_T *rettv, evalarg_T *evalarg)
ga_clear_strings(&newlines);
vim_free(fp);
vim_free(pt);
if (evalarg->eval_tofree == NULL)
if (evalarg != NULL && evalarg->eval_tofree == NULL)
evalarg->eval_tofree = tofree;
else
vim_free(tofree);
Expand Down
2 changes: 2 additions & 0 deletions src/version.c
Original file line number Diff line number Diff line change
Expand Up @@ -754,6 +754,8 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
/**/
1162,
/**/
1161,
/**/
Expand Down

0 comments on commit efaaaa6

Please sign in to comment.