summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-12-08 18:41:34 +0100
committerBram Moolenaar <Bram@vim.org>2019-12-08 18:41:34 +0100
commit0ff822d2ebf0d130516631734b00179ba8dd8251 (patch)
tree87511bbe82022b075a96850a7e4a6009a6a67fce /src
parent1b03a193b3394597e4ed86aeea1e1b2c60ae9ad2 (diff)
patch 8.1.2412: crash when evaluating expression with errorv8.1.2412
Problem: Crash when evaluating expression with error. (Dhiraj Mishra) Solution: Check parsing failed. (closes #5329)
Diffstat (limited to 'src')
-rw-r--r--src/eval.c2
-rw-r--r--src/testdir/test_lambda.vim5
-rw-r--r--src/version.c2
3 files changed, 8 insertions, 1 deletions
diff --git a/src/eval.c b/src/eval.c
index 178f47388e..3b563f7dbe 100644
--- 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
index 7689219955..c55de67b52 100644
--- 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
index d4a677c797..1d6d323bc5 100644
--- 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,