mirror of
https://github.com/vim/vim.git
synced 2025-07-25 10:54:51 -04:00
patch 9.0.0360: crash when invalid line number on :for is ignored
Problem: Crash when invalid line number on :for is ignored. Solution: Do not check breakpoint for non-existing line.
This commit is contained in:
parent
8deb2b30c7
commit
35d21c6830
@ -1068,7 +1068,7 @@ do_cmdline(
|
|||||||
|
|
||||||
// Check for the next breakpoint at or after the ":while"
|
// Check for the next breakpoint at or after the ":while"
|
||||||
// or ":for".
|
// or ":for".
|
||||||
if (breakpoint != NULL)
|
if (breakpoint != NULL && lines_ga.ga_len > current_line)
|
||||||
{
|
{
|
||||||
*breakpoint = dbg_find_breakpoint(
|
*breakpoint = dbg_find_breakpoint(
|
||||||
getline_equal(fgetline, cookie, getsourceline),
|
getline_equal(fgetline, cookie, getsourceline),
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
" Tests for various eval things.
|
" Tests for various eval things.
|
||||||
|
|
||||||
source view_util.vim
|
source view_util.vim
|
||||||
|
source shared.vim
|
||||||
|
|
||||||
function s:foo() abort
|
function s:foo() abort
|
||||||
try
|
try
|
||||||
@ -87,6 +88,18 @@ func Test_for_over_null_string()
|
|||||||
let &enc = save_enc
|
let &enc = save_enc
|
||||||
endfunc
|
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()
|
func Test_readfile_binary()
|
||||||
new
|
new
|
||||||
call setline(1, ['one', 'two', 'three'])
|
call setline(1, ['one', 'two', 'three'])
|
||||||
|
@ -707,6 +707,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
360,
|
||||||
/**/
|
/**/
|
||||||
359,
|
359,
|
||||||
/**/
|
/**/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user