mirror of
https://github.com/neovim/neovim.git
synced 2025-09-13 06:48:17 +00:00
vim-patch:8.1.2412: crash when evaluating expression with error (#17109)
This commit is contained in:
@@ -4402,7 +4402,7 @@ static int eval_lambda(char_u **const arg, typval_T *const rettv, const bool eva
|
|||||||
rettv->v_type = VAR_UNKNOWN;
|
rettv->v_type = VAR_UNKNOWN;
|
||||||
|
|
||||||
int ret = get_lambda_tv(arg, rettv, evaluate);
|
int ret = get_lambda_tv(arg, rettv, evaluate);
|
||||||
if (ret == NOTDONE) {
|
if (ret != OK) {
|
||||||
return FAIL;
|
return FAIL;
|
||||||
} else if (**arg != '(') {
|
} else if (**arg != '(') {
|
||||||
if (verbose) {
|
if (verbose) {
|
||||||
|
@@ -303,3 +303,8 @@ func Test_lambda_with_index()
|
|||||||
let Extract = {-> function(List, ['foobar'])()[0]}
|
let Extract = {-> function(List, ['foobar'])()[0]}
|
||||||
call assert_equal('foobar', Extract())
|
call assert_equal('foobar', Extract())
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
func Test_lambda_error()
|
||||||
|
" This was causing a crash
|
||||||
|
call assert_fails('ec{@{->{d->()()', 'E15')
|
||||||
|
endfunc
|
||||||
|
Reference in New Issue
Block a user