Skip to content
Permalink
Browse files

patch 8.1.2412: crash when evaluating expression with error

Problem:    Crash when evaluating expression with error. (Dhiraj Mishra)
Solution:   Check parsing failed. (closes #5329)
  • Loading branch information
brammool committed Dec 8, 2019
1 parent 1b03a19 commit 0ff822d2ebf0d130516631734b00179ba8dd8251
Showing with 8 additions and 1 deletion.
  1. +1 −1 src/eval.c
  2. +5 −0 src/testdir/test_lambda.vim
  3. +2 −0 src/version.c
@@ -2902,7 +2902,7 @@ eval_lambda(
rettv->v_type = VAR_UNKNOWN;

ret = get_lambda_tv(arg, rettv, evaluate);
if (ret == NOTDONE)
if (ret != OK)
return FAIL;
else if (**arg != '(')
{
@@ -302,3 +302,8 @@ func Test_lambda_with_index()
let Extract = {-> function(List, ['foobar'])()[0]}
call assert_equal('foobar', Extract())
endfunc

func Test_lambda_error()
" This was causing a crash
call assert_fails('ec{@{->{d->()()', 'E15')
endfunc
@@ -742,6 +742,8 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
/**/
2412,
/**/
2411,
/**/

0 comments on commit 0ff822d

Please sign in to comment.
You can’t perform that action at this time.