To: vim_dev@googlegroups.com Subject: Patch 8.2.1037 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.1037 Problem: Vim9: crash when using line continuation inside :def. Solution: Check for no more lines available. Files: src/vim9compile.c, src/testdir/test_vim9_func.vim *** ../vim-8.2.1036/src/vim9compile.c 2020-06-21 22:17:15.056232636 +0200 --- src/vim9compile.c 2020-06-22 19:38:13.644541887 +0200 *************** *** 2402,2409 **** while (++lnum < cctx->ctx_ufunc->uf_lines.ga_len) { char_u *line = ((char_u **)cctx->ctx_ufunc->uf_lines.ga_data)[lnum]; ! char_u *p = skipwhite(line); if (*p != NUL && !comment_start(p)) return p; } --- 2402,2412 ---- while (++lnum < cctx->ctx_ufunc->uf_lines.ga_len) { char_u *line = ((char_u **)cctx->ctx_ufunc->uf_lines.ga_data)[lnum]; ! char_u *p; + if (line == NULL) + break; + p = skipwhite(line); if (*p != NUL && !comment_start(p)) return p; } *** ../vim-8.2.1036/src/testdir/test_vim9_func.vim 2020-06-20 22:50:44.175608236 +0200 --- src/testdir/test_vim9_func.vim 2020-06-22 19:37:36.132654678 +0200 *************** *** 837,841 **** --- 837,852 ---- res = [1, 2, 3]->sort() enddef + def Line_continuation_in_def(dir: string = ''): string + let path: string = empty(dir) + \ ? 'empty' + \ : 'full' + return path + enddef + + def Test_line_continuation_in_def() + assert_equal('full', Line_continuation_in_def('.')) + enddef + " vim: ts=8 sw=2 sts=2 expandtab tw=80 fdm=marker *** ../vim-8.2.1036/src/version.c 2020-06-22 19:24:18.811085212 +0200 --- src/version.c 2020-06-22 19:34:26.457226420 +0200 *************** *** 756,757 **** --- 756,759 ---- { /* Add new patch number below this line */ + /**/ + 1037, /**/ -- [Another hideous roar.] BEDEVERE: That's it! ARTHUR: What? BEDEVERE: It's The Legendary Black Beast of Aaaaarrrrrrggghhh! "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD /// Bram Moolenaar -- Bram@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 ///