Patch 9.0.0360

4 views
Skip to first unread message

Bram Moolenaar

unread,
Sep 2, 2022, 11:49:18 AM9/2/22
to vim...@googlegroups.com

Patch 9.0.0360
Problem: Crash when invalid line number on :for is ignored.
Solution: Do not check breakpoint for non-existing line.
Files: src/ex_docmd.c, src/testdir/test_eval_stuff.vim


*** ../vim-9.0.0359/src/ex_docmd.c 2022-09-01 16:00:49.730496296 +0100
--- src/ex_docmd.c 2022-09-02 16:43:37.859130862 +0100
***************
*** 1068,1074 ****

// Check for the next breakpoint at or after the ":while"
// or ":for".
! if (breakpoint != NULL)
{
*breakpoint = dbg_find_breakpoint(
getline_equal(fgetline, cookie, getsourceline),
--- 1068,1074 ----

// Check for the next breakpoint at or after the ":while"
// or ":for".
! if (breakpoint != NULL && lines_ga.ga_len > current_line)
{
*breakpoint = dbg_find_breakpoint(
getline_equal(fgetline, cookie, getsourceline),
*** ../vim-9.0.0359/src/testdir/test_eval_stuff.vim 2022-08-16 17:50:33.959764427 +0100
--- src/testdir/test_eval_stuff.vim 2022-09-02 16:45:30.719094486 +0100
***************
*** 1,6 ****
--- 1,7 ----
" Tests for various eval things.

source view_util.vim
+ source shared.vim

function s:foo() abort
try
***************
*** 87,92 ****
--- 88,105 ----
let &enc = save_enc
endfunc

+ func Test_for_invalid_line_count()
+ let lines =<< trim END
+ 111111111111111111111111 for line in ['one']
+ endfor
+ END
+ call writefile(lines, 'XinvalidFor')
+ " only test that this doesn't crash
+ call RunVim([], [], '-u NONE -e -s -S XinvalidFor -c qa')
+
+ call delete('XinvalidFor')
+ endfunc
+
func Test_readfile_binary()
new
call setline(1, ['one', 'two', 'three'])
*** ../vim-9.0.0359/src/version.c 2022-09-02 15:15:11.067569180 +0100
--- src/version.c 2022-09-02 16:30:10.915340578 +0100
***************
*** 709,710 ****
--- 709,712 ----
{ /* Add new patch number below this line */
+ /**/
+ 360,
/**/

--
I once paid $12 to peer at the box that held King Tutankhamen's little
bandage-covered midget corpse at the De Young Museum in San Francisco. I
remember thinking how pleased he'd be about the way things turned out in his
afterlife.
(Scott Adams - The Dilbert principle)

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