Patch 8.2.2528

6 views
Skip to first unread message

Bram Moolenaar

unread,
Feb 17, 2021, 12:49:47 PM2/17/21
to vim...@googlegroups.com

Patch 8.2.2528
Problem: Vim9: crash when compiling lambda fails.
Solution: Bail out after compilation fails. (closes #7862)
Files: src/eval.c, src/testdir/test_vim9_assign.vim


*** ../vim-8.2.2527/src/eval.c 2021-02-17 17:00:23.483706812 +0100
--- src/eval.c 2021-02-17 18:23:41.128024776 +0100
***************
*** 3428,3435 ****
ufunc_T *ufunc = rettv->vval.v_partial->pt_func;

// compile it here to get the return type
! compile_def_function(ufunc,
! TRUE, PROFILING(ufunc), NULL);
}
}
if (ret == NOTDONE)
--- 3428,3439 ----
ufunc_T *ufunc = rettv->vval.v_partial->pt_func;

// compile it here to get the return type
! if (compile_def_function(ufunc,
! TRUE, PROFILING(ufunc), NULL) == FAIL)
! {
! clear_tv(rettv);
! ret = FAIL;
! }
}
}
if (ret == NOTDONE)
*** ../vim-8.2.2527/src/testdir/test_vim9_assign.vim 2021-02-17 17:00:23.483706812 +0100
--- src/testdir/test_vim9_assign.vim 2021-02-17 18:47:26.024462104 +0100
***************
*** 1118,1123 ****
--- 1118,1128 ----
Ref = (j) => !j
END
CheckDefAndScriptFailure(lines, 'E1012: Type mismatch; expected func(number) but got func(any): bool')
+
+ lines =<< trim END
+ echo filter([1, 2, 3], (_, v: string) => v + 1)
+ END
+ CheckDefAndScriptFailure(lines, 'E1051:')
enddef

def Test_heredoc()
*** ../vim-8.2.2527/src/version.c 2021-02-17 17:00:23.483706812 +0100
--- src/version.c 2021-02-17 18:25:27.799787570 +0100
***************
*** 752,753 ****
--- 752,755 ----
{ /* Add new patch number below this line */
+ /**/
+ 2528,
/**/

--
There can't be a crisis today, my schedule is already full.

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
Reply all
Reply to author
Forward
0 new messages