Patch 8.2.1760

5 views
Skip to first unread message

Bram Moolenaar

unread,
Sep 27, 2020, 12:24:44 PM9/27/20
to vim...@googlegroups.com

Patch 8.2.1760
Problem: Vim9: crash when end marker is missing. (Dhiraj Mishra)
Solution: Check for end of function lines. (closes #7031)
Files: src/vim9compile.c, src/testdir/test_vim9_assign.vim


*** ../vim-8.2.1759/src/vim9compile.c 2020-09-27 15:19:23.642118924 +0200
--- src/vim9compile.c 2020-09-27 18:23:00.139468653 +0200
***************
*** 4360,4366 ****

for (;;)
{
! if (cctx->ctx_lnum == cctx->ctx_ufunc->uf_lines.ga_len)
return NULL;
++cctx->ctx_lnum;
p = ((char_u **)cctx->ctx_ufunc->uf_lines.ga_data)[cctx->ctx_lnum];
--- 4360,4366 ----

for (;;)
{
! if (cctx->ctx_lnum >= cctx->ctx_ufunc->uf_lines.ga_len - 1)
return NULL;
++cctx->ctx_lnum;
p = ((char_u **)cctx->ctx_ufunc->uf_lines.ga_data)[cctx->ctx_lnum];
*** ../vim-8.2.1759/src/testdir/test_vim9_assign.vim 2020-09-27 14:22:45.006688671 +0200
--- src/testdir/test_vim9_assign.vim 2020-09-27 18:22:31.175562404 +0200
***************
*** 740,745 ****
--- 740,761 ----

CheckDefFailure(['var lines =<< trim END X', 'END'], 'E488:')
CheckDefFailure(['var lines =<< trim END " comment', 'END'], 'E488:')
+
+ lines =<< trim [END]
+ def Func()
+ var&lines =<< trim END
+ x
+ x
+ x
+ x
+ x
+ x
+ x
+ x
+ enddef
+ call Func()
+ [END]
+ CheckScriptFailure(lines, 'E990:')
enddef

" vim: ts=8 sw=2 sts=2 expandtab tw=80 fdm=marker
*** ../vim-8.2.1759/src/version.c 2020-09-27 17:57:39.508086116 +0200
--- src/version.c 2020-09-27 18:18:57.540272520 +0200
***************
*** 752,753 ****
--- 752,755 ----
{ /* Add new patch number below this line */
+ /**/
+ 1760,
/**/

--
login: yes
password: I don't know, please tell me
password is incorrect
login: yes
password: incorrect

/// 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