# HG changeset patch # User Bram Moolenaar # Date 1575827103 -3600 # Node ID 3cf9529b3a4a1c9bd06c86eba2432141475c6c21 # Parent cdf752086b5419507a184f261241faece0ac7c58 patch 8.1.2412: crash when evaluating expression with error Commit: https://github.com/vim/vim/commit/0ff822d2ebf0d130516631734b00179ba8dd8251 Author: Bram Moolenaar Date: Sun Dec 8 18:41:34 2019 +0100 patch 8.1.2412: crash when evaluating expression with error Problem: Crash when evaluating expression with error. (Dhiraj Mishra) Solution: Check parsing failed. (closes https://github.com/vim/vim/issues/5329) diff --git a/src/eval.c b/src/eval.c --- a/src/eval.c +++ b/src/eval.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 != '(') { diff --git a/src/testdir/test_lambda.vim b/src/testdir/test_lambda.vim --- a/src/testdir/test_lambda.vim +++ b/src/testdir/test_lambda.vim @@ -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 diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -743,6 +743,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 2412, +/**/ 2411, /**/ 2410,