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 -- [email protected] -- 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    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/202009271624.08RGOaD4194719%40masaka.moolenaar.net.

Raspunde prin e-mail lui